in reply to Re: Extract sequence of UC words?
in thread Extract sequence of UC words?
\b([A-Z\s]+)\b
This doesn't work because the space in the character class means it matches the first single space in the line and returns that. You need to ensure that the match starts with an UPPER alpha, and then continues with UPPER alpha or space:
print $data =~ m/(\b[A-Z][A-Z ]+\b)/;; TEST SENTENCE
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Extract sequence of UC words?
by monarch (Priest) on Aug 18, 2008 at 17:01 UTC | |
by BrowserUk (Patriarch) on Aug 18, 2008 at 17:13 UTC | |
by monarch (Priest) on Aug 18, 2008 at 17:58 UTC | |
by BrowserUk (Patriarch) on Aug 19, 2008 at 06:31 UTC | |
by johngg (Canon) on Aug 19, 2008 at 14:05 UTC | |
|
Re^3: Extract sequence of UC words?
by gaal (Parson) on Aug 18, 2008 at 15:58 UTC | |
|
Re^3: Extract sequence of UC words?
by dHarry (Abbot) on Aug 18, 2008 at 14:26 UTC |