|
|
| Problems? Is your data what you think it is? | |
| PerlMonks |
Re: Re: Is there a better way to write this RegEx?by theAcolyte (Pilgrim) |
| on Apr 20, 2004 at 09:06 UTC ( [id://346615]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
That seems to work, despite the fact I was under the impression that the first .* would gobble up the entire line, being greedy and all.
Also, I guess I should have said I'm attempting to avoid .* ... learning experience, I guess. but, yes, this seems like a much more elegant solution then the one I had written by far. I'm still trying to figure out why the .* doesn't grab the entire line ... because of the second .*, I guess? And, I'm going to see if I can find rindex in the perldocs because, frankly, I've never seen/heard of it before. :)
- Erik ps. I know there are log parsers on CPAN, but I'm just mucking around ... i have a full script doing what I want and working just fine ... but I noticed how ugly my regEx was and wanted to see how to improve on it :)
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||