in reply to How to write a regular expression to extract a number from an embedded string?
produces:#!/bin/perl5 use strict; use warnings; my @array = ( 'abcedf 5163 1234 5678', '1234516323943293' ); for ( @array ){ /(5163.*)/; print "$1\n"; }
5163 1234 5678 516323943293
Update: Whoops. It looks as though I didn't read the question properly. See pbeckingham comment below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to write a regular expression to extract a number from an embedded string?
by pbeckingham (Parson) on Jul 28, 2004 at 16:54 UTC |