Your question is a bit wide, as you don't tell us how your data is structured. I recommend http://www.activestate.com and their Komodo GUI, which has a regex explorer to become accustomed to regular expressions.
For the sake of the node, let's assume that your data is CSV data (see Text::xSV, also on CPAN), and that you don't want (for some obscure reason) to use Text::XSV.
What I'm going to do now is to construct a regular expression that skips n semicolons and then tries to match =nnn; :
$line =~ m/(?: # Collect heading fields [^;]+ # delimited by semicolons ; ){1} # In your case, there is only one field before t +he interesting field = # followed by a "=" (\d+) # and followed by our numbers, stuff them into $ +1 ; # and delimited by another semicolon /x;
Another good approach would have been to split() the line on ";" and then munge the second element of that list afterwards.
In reply to Re: Reg ex question
by Corion
in thread Reg ex question
by costas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |