the code worked fine with just one (\s) whitespace character between number and "to" but with the (.+) it truncates the variable or something. Please help me monks, thanks in advance. Jono#!/usr/bin/perl while(<>){ print if m!(\d+)to(\d+)!i; print "$1\n"; print "$2\n"; } but when i add (.+) the variables ($1, $2) aren't diplayed the same: #!/usr/bin/perl while(<>){ print if m!(\d+).+to.+(\d+)!i; print "$1\n"; print "$2\n"; }
In reply to $1 and regex by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |