learingperl01
MIS
Hello perl experts, I am hoping that someone can point me in the right direction.
I am running regex matches on a file which contains alpha numeric data. I am trying to figure out how to only match or print exactly what I am searching for instead of additional data.
For example.
Here is what I would like the output to look like
Here is the output I am currently getting
Not sure how go get only what I am matching on to print. The reason is that I am running some checks against the last {10} alphanumeric numbers and when I do those checks they aren't at the correct place because the $string is holding additional data.
I am running regex matches on a file which contains alpha numeric data. I am trying to figure out how to only match or print exactly what I am searching for instead of additional data.
For example.
Code:
while (<DATA>) {
my $string = $_;
if ($string =~ /5599686e3213df2d[a-z0-9]{10}/gi) {
print $string, "\n";
}
__DATA__
938483984zdkkl3993084083ljlj093840j304803840j5599686e3213df2dldj0483037408d0rh
Here is what I would like the output to look like
Code:
5599686e3213df2dldj0483037
Here is the output I am currently getting
Code:
938483984zdkkl3993084083ljlj093840j304803840j5599686e3213df2dldj0483037408d0rh