in reply to Problem with RegEx & various "endings"
this puts in $1 the first word of the string, where "word" means "the first sequence of letters ended by "]", " " or "_". Add other delimiters if needed. In the case of "]", it also checks for an optional leading "[".$teststring =~ /^[[]?([^] _]+)/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with RegEx & various "endings"
by timesink (Initiate) on Jul 01, 2008 at 14:36 UTC |