There's more than one way to do things | |
PerlMonks |
Re: help on reg exby svsingh (Priest) |
on May 07, 2003 at 15:39 UTC ( [id://256253]=note: print w/replies, xml ) | Need Help?? |
I'm not really clear on what you're asking for with extracting /great and putting it back. Both the inital and resulting $a's in your question look the same to me.
Here's what I came up with...
Note: I'm using /x to add some whitespace to the regex for clarity. You can ignore the spaces. That returns...
I think the other solutions are affected by regex greed. So they'll pull out the longest string starting with a slash. If I'm oversimplifying things, then I'm sorry. I hope this helps.
In Section
Seekers of Perl Wisdom
|
|