W
whiskey
I couldn't find any help on the web (also tried on another group) and
I'm not sure if this is the right place to ask such things. However, I
think most Perl programmers know regular expressions well.
So, my question is: how do I match, using a regular expression,
another regular expression within a string ?
Example: given a string like "$foo =~ /regexp/"*, I want to split it
into tokens: TOK_VAR -> $foo, TOK_BINDOP -> =~, TOK_REGEXP -> /
regexp/. For this, I'm using regular expressions. So how do I match
the regular expression ? Sure, in this example it may be easy, but
what about a string like "$foo =~ /regexp/ && $bar =~ /pxeger/" ?
* No, I'm not writing a Perl interpreter, I just want to know if it is
possible to avoid parsing the string
I'm not sure if this is the right place to ask such things. However, I
think most Perl programmers know regular expressions well.
So, my question is: how do I match, using a regular expression,
another regular expression within a string ?
Example: given a string like "$foo =~ /regexp/"*, I want to split it
into tokens: TOK_VAR -> $foo, TOK_BINDOP -> =~, TOK_REGEXP -> /
regexp/. For this, I'm using regular expressions. So how do I match
the regular expression ? Sure, in this example it may be easy, but
what about a string like "$foo =~ /regexp/ && $bar =~ /pxeger/" ?
* No, I'm not writing a Perl interpreter, I just want to know if it is
possible to avoid parsing the string