| | |
| | |
| | |
| | Enter the string that you want to use a regular expression on: |
|
| | Select the elements that you want to extract to run regular expression generator: |
2 | | What to click? | extract any integer in this position |  | extract this integer (2006) in this position |
| |
|
| |
3 | | Perl regular expression program that extracts the selected elements from the entered string: |
| | | | |
#!/usr/bin/perl
$txt='42 43';
$re1='(\\d+)';
$re2='(4)';
$re3='.*?';
$re4='\\d+';
$re5='.*?';
$re6='(\\d+)';
$re=$re1.$re2.$re3.$re4.$re5.$re6;
if ($txt =~ m/$re/is)
{
$int1=$1;
$c1=$2;
$int2=$3;
print "($int1) ($c1) ($int2) \n";
}
| | |
|
|
  |