Greetings to all
I need to process two (and possibly a third) group of patterns in my input . My current code snippet for this is:
while ($data_in =~ /<container><a>(.+?)<\/a><b>(.+?)<\/b><\/container> +(<\?query\?>)??/ig) { $data_out = "$2, $1$3 "; errors here ; further processing here }
However I am getting this error: 'Use of uninitialized value in concatenation (.) or string' referring I believe to $3 when it does not exist.
I did try the following:
while ($data_in =~ /<container><a>(.+?)<\/a><b>(.+?)<\/b><\/container> +(<\?query\?>)??/ig) { if ($+ =~ /<\?query\?>/i) {; errors here now $data_out = "$2, $1$3 "; } else { $data_out = "$2, $1 "; } ; further processing here }
But then I get this:
Use of uninitialized value in pattern match (m//)
Of course there is probably a much simpler way of achieving this.
Thanks for any advice
fiat
In reply to Special Variables in Regular Expression by fiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |