| | |
| | |
| | |
| | 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='.*?';
$re3='\\d+';
$re4='.*?';
$re5='(\\d+)';
$re=$re1.$re2.$re3.$re4.$re5;
if ($txt =~ m/$re/is)
{
$d1=$1;
$int1=$2;
print "($d1) ($int1) \n";
}
| | |
|
|
  |