use warnings; use strict; my @f =( "Figure. 89-9","Figure 12-8","Figure 1.2"); foreach(@f) { if($_=~m/fig(. |[a-z])*(\d+)(\-(\d+))?/i) { print " $2-$4 \n"; } }
its output comes like
89-9 12-8 1-
but am need output like this one 89-9 12-8 1.2
how to print both one's - (or). how to handle both in single regular expression
In reply to how to do get digit numbers like -,.? by virudinesh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |