I'm not following the entire piece of code, but I'd like to point out that that big built-up regex probably isn't what you want. You may want to think about building it up with the qr operator, that way you can embed your comments much more cleanly, e.g.:
And then I suggest running the resultant object through something like YAPE::Regex::Explain. I don't think this is what you really want.my $pattern = qr/ S[s|p] # match the link label (?:[\w\*]{1,2})* # match any optional subscripts :(\d+): # match number of the word (\w+(?:\.\w)*) # match and save the word itself [^\)]+ # match other stuff within parenthesis "(rock[s|ed]*).v"# match and store verb [^(?:O.{1,2}: # don't match objects \d+\:\w+(?:\.\w)*)]*\) /xm;
e.g., [s|p] matches s, |, or p. Not "s or p". Or what you have for "don't match objects" displays a common misconception about how the square brackets work. The Y::R::E tool will help you understand what you have there.
Hope this helps - good luck!
In reply to Re: LinkParser new_as_string
by Tanktalus
in thread LinkParser new_as_string
by rael438
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |