I want print out the match vaule.
But Perl will make B[0] become B0.
Is there any way to slove it?
please help, thanks.
my $line = 'pin B[0] 10'; my $inputName = 'B[0]'; if($line =~ m/[\w]+[\s]+$inputName[\s]+([\.\d]+)/){ print "$1\n"; }
In reply to Regular expression & raw data by luckysummer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |