jimmyellis
Technical User
Please excuse my limited grasp of Perl and regular expressions.
I'm trying to match lines such as the following:
4 4 4 6 1/2 4 3/4 10 9 1/4 12 20 1/4
The line ends with a carriage return. The sequence is the same, with a number followed either by a fraction or another number followed by a fraction. So above, the individual sections would be:
4 4
4 6 1/2
4 3/4
10 9 1/4
12 20 1/4
The match is fine until I get to the last sequence where I only get back the 12 and 20. The 1/4 is not matched. The code is the same throughout and there are spaces accounted for between each of the sequences.The final sequence space is followed by a carriage return (this is a WORD file).
Here's my primitive code for each sequence:
(\d{0,2})\s(\d\/\d|\d{0,2} \d\/\d|\d{0,2})\s
How do I match the last sequence?
Thanks in advance
I'm trying to match lines such as the following:
4 4 4 6 1/2 4 3/4 10 9 1/4 12 20 1/4
The line ends with a carriage return. The sequence is the same, with a number followed either by a fraction or another number followed by a fraction. So above, the individual sections would be:
4 4
4 6 1/2
4 3/4
10 9 1/4
12 20 1/4
The match is fine until I get to the last sequence where I only get back the 12 and 20. The 1/4 is not matched. The code is the same throughout and there are spaces accounted for between each of the sequences.The final sequence space is followed by a carriage return (this is a WORD file).
Here's my primitive code for each sequence:
(\d{0,2})\s(\d\/\d|\d{0,2} \d\/\d|\d{0,2})\s
How do I match the last sequence?
Thanks in advance