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;
In reply to Re: Str extract the word between the first and the 2nd '|' character
by FunkyMonk
in thread Str extract the word between the first and the 2nd '|' character
by dani_cv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |