in reply to Str extract the word between the first and the 2nd '|' character
my ( $second_word ) = $string =~ m{\|([^|]*)\|};
Or, in more detail:
my ( $second_word ) = $string =~ m{ \| # "|" escaped because it's special inside a regexp ( # start capturing [^|]* # some not |'s ) # end capture \| # another "|" }x;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Str extract the word between the first and the 2nd '|' character
by dani_cv (Acolyte) on Apr 11, 2008 at 14:16 UTC | |
by dani_cv (Acolyte) on Apr 11, 2008 at 14:39 UTC | |
by kyle (Abbot) on Apr 11, 2008 at 14:56 UTC | |
by FunkyMonk (Bishop) on Apr 11, 2008 at 14:59 UTC |