How about this?
Update: modified code. Thanks davidomy $string = 'abcdef 5163 1234 5678'; my $extracted = $string =~ /(5163(?:\d{8}|\s\d{4}\s\d{4}))/;
In reply to Re: How to write a regular expression to extract a number from an embedded string?
by pbeckingham
in thread How to write a regular expression to extract a number from an embedded string?
by jwking
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |