Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Regex helpby PetaMem (Priest) |
on Dec 11, 2012 at 11:43 UTC ( [id://1008280]=note: print w/replies, xml ) | Need Help?? |
This is one of the easiest tasks for Perl. Contrary to the one-liner that would do, some more verbose code:
If you have the strings scattered around your file, possibly several on one line, you better use the global modifier and a while loop. You also should tighten your regex then - specifying the ID more exact:
E.g. if you knew, all your Id's started with an upper-case letter and have always 8 digits, that would be
Bye
In Section
Seekers of Perl Wisdom
|
|