Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to get the servername from the string as below: string: "R4:abcxyz45:LNX" From this I am trying to extract "abcxyz45" using regular expression. Below is the code I am using but not getting any return value. What I am doing wrong? any idea.
Thanks$str = "R4:abcxyz45:LNX"; $str =~ /[\w\d]+(^:[\w\d]+:$)\w+/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp help
by kennethk (Abbot) on Sep 03, 2010 at 16:26 UTC | |
by toolic (Bishop) on Sep 03, 2010 at 16:48 UTC | |
by Anonymous Monk on Sep 03, 2010 at 16:31 UTC | |
|
Re: Regexp help
by toolic (Bishop) on Sep 03, 2010 at 16:43 UTC | |
|
Re: Regexp help
by talexb (Chancellor) on Sep 03, 2010 at 17:31 UTC | |
by Marshall (Canon) on Sep 03, 2010 at 19:48 UTC | |
by jwkrahn (Abbot) on Sep 03, 2010 at 17:51 UTC | |
|
Re: Regexp help
by dasgar (Priest) on Sep 03, 2010 at 16:52 UTC |