|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Regex matchingby Anonymous Monk |
| on Jul 03, 2002 at 07:41 UTC ( [id://179125]=perlquestion: 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.Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: I am trying to match a data structure with a regex. I'm new to regex, but have made a start. The structure consists of 5 character blocks, seperated by spaces. The 1st is always 'UFOFH', then there are a number of blocks containing digits 0-9 and the / character. There are anywhere between 4 to 27 of these blocks. An example with 20 such blocks is below: UFOFH 33603 01231 /0000 0024/ 1024/ 2025/ 3027/ 4030/ 5025/ 6028/ 7060/ 8081/ 9098/ 0110/ 1107/ 2106/ 3102/ 4080/ 5065/ 6057/ <\p> I have tried the below, and some varations (the # is the regex seperator):
But this only returns the penultimate charcter block before the newline (eg. '5065/') I have played around with the brackets, finding that this only returns specific bits of the structure (eg. one set of numbers). How do I wite the regex to return the whole structure from the UFOFH all the way to the last 5 character block? Thanks
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||