fionbarr has asked for the wisdom of the Perl Monks concerning the following question:
I want to capture the chars before the first '_' but what I end up with is:wppwd01a0099_NET_basp_virtual_adapter
The regular expression I'm trying is:wppwd01a0099_NET_basp_virtual
what am I doing wrong?if ( $this_server =~ m/^(\w+)_/ ) { $this_server = $1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: minimal match regular expression
by toolic (Bishop) on Mar 03, 2015 at 16:34 UTC | |
by fionbarr (Friar) on Mar 03, 2015 at 16:37 UTC | |
by james28909 (Deacon) on Mar 03, 2015 at 16:56 UTC | |
by AnomalousMonk (Archbishop) on Mar 03, 2015 at 20:51 UTC | |
by fionbarr (Friar) on Mar 03, 2015 at 19:40 UTC | |
|
Re: minimal match regulara expression
by trippledubs (Deacon) on Mar 03, 2015 at 17:19 UTC | |
|
Re: minimal match regulara expression
by Laurent_R (Canon) on Mar 03, 2015 at 18:06 UTC | |
|
Re: minimal match regulara expression
by fionbarr (Friar) on Mar 03, 2015 at 16:19 UTC |