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):print $mailbox =~ m#UFOFH ([0-9//]{5} ){4,27}#ig;
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
In reply to Regex matching by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |