regex - Regular Expression Compiler -


I only need to use regular expressions in some of the tasks I have done. However, in those few times I have found a very powerful form of expression that enables me to do some very useful things.

The problem is that the language used for regular expression is wrong - full stop.

It is wrong with a psychological view - the use of unconnected symbols only provides a useful context for people with acetic memory, although the syntax rules are clearly my experience and which I have learned from others, a regular Form expression that can prove to be a difficult task for everyone successfully but clearly defined in the most trivial situations Ia is it makes sense because it is a typical analog set theory, which is a very complex thing.

One thing that can prove difficult is dissolving the expression which you are working in your discrete parts. Due to the nature of language, it is possible to read a regular expression in many ways, if you do not understand its primary goal, then it is difficult to understand the reincarnations of other people. I believe in the study of natural language that it is called pragmatic.

The question I want to ask is this - is there such a thing as a regular expression compiler? Or anybody can be made?

As an assembly language, from an approachable perspective, it may be possible to consider regexes - some similarities can be designed to compile a more natural language - a higher language - regular expression Can change in Then in my code, I can define my regex using a high level language in a header file and by using a symbolic reference it can refer to where it is necessary. I and others can see my code in the header file and try to get it with my rezepses and appreciate it more easily.

I know that it can be done logically, otherwise the computer is possible, but if you have read it, will you consider investing time in realizing it?

1)

Code> switch permits and comments and whotsis to be included within the reges.

2) If you do not like the line-noise-like symbol yourself, then it is possible that you can spread a complex reggae on many structures. It is not very difficult to write your own works, which make regular expressions such as in Perl:

  sub at_start {'^'; } Sub at_end {'$'; } Any {"."; } Sub zero_or_more {"(?: $ _ [0]) *"; } One or more {"(?: $ _ [0]) +"; } Sub Alternatives {"(?: $ _ [0])?"; } Sub Remember {"($ _ [0])"; } Sub an_off {"(?:". Include ("|", @_). ")"; } Sub-in_charset {"[$ _ [0]]"; } # I know that this is broken for ']' ... sub not_in_charset {"[^ $ _ [0]]"; } # I know that this is broken for ']' ...  

Then a quoted string ( / ^ "(?: [^ \\"]) | \ * * * "/ ):

  at_start '' '' zero '' or '_' (one_f (not_in_charset ('\\\) '', 'Yuk', level 2 'escaping the required level'.). '' ''  

Using it, the strategy of "string building functions" is to make useful panel blocks Lenders to express as functions (such as the above rezx quoted_ String can be stored in a function called , you can perform other tasks to match any numeric value reliably, an email address, etc.).


Comments