blackadder has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to capture the first 3 chars and all the digits up to the first dot from the left. So I put this bit of code togetheruk1sxve01205.gfjgjf5.fdhd5 usasxve513.gfdhf4.hgfd4
But @RS only contains one element! Instead of what I expected that \d+)/g); will place each digit as an array element in @RS!my ($Site_Code, @RS) = ($String=~ /^(...)....(\d+)/g);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using regex to capture a string and an array
by jettero (Monsignor) on Nov 01, 2009 at 13:33 UTC | |
by wol (Hermit) on Nov 02, 2009 at 16:26 UTC | |
|
Re: using regex to capture a string and an array
by BioLion (Curate) on Nov 01, 2009 at 13:53 UTC | |
|
Re: using regex to capture a string and an array
by AnomalousMonk (Archbishop) on Nov 01, 2009 at 18:38 UTC | |
|
Re: using regex to capture a string and an array
by ikegami (Patriarch) on Nov 01, 2009 at 18:36 UTC |