Hi All,
Could you please help with the following issue:
While searching for multiple patterns on the same string, search continues from previous successful match point in the string. Is this expected ? How to make each pattern search start from beginning of the string each time.
Thanks a lot!!
open (MYFILE, "< $dir_dump$file") || die "Could not read dump file\n +"; while (<MYFILE>){ $dumpbuf .= $_; } $dumpbuf =~ s/\s//gs; die "Not a valid file, Check output!" if $dumpbuf !~ m/\d/gs; #match + one die "File contains only zeros, Check output!" if $dumpbuf !~ m/[1-9] +/sg; #match two while ($dumpbuf =~ m/(\w)/gs) { print "==$1\n"; # prints characters after initial two matches }
In reply to Regex String by egal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |