My suggestion is to post in one node the sample text, and the regular expression that is failing to match where you expect it to. Post them well formatted, using the tips found in Writeup Formatting Tips, and be sure that you're posting actual full copy and pastes of the text and code that fail.
When I test the text you provided, and the regexp you provided in the preceding node, I got the following results:
$1 => Melville
$2 => New York
$3 => /s/KPMG LLP
${^PREMATCH} => ended June 30, 2001 in conformity with accounting principles generally accepted
in the United States of America. Also in our opinion, the related financial
statement schedule, when considered in relation to the basic consolidated
financial statements taken as a whole, presents fairly, in all material
respects, the information set forth therein.
${^MATCH} =>
Melville, New York /s/KPMG LLP${^POSTMATCH} =>
September 26, 2001
STR$^N => /s/KPMG LLP
@- => (352,354,364,372)
@+ => (411,362,372,411)
The text I used was exactly this:
ended June 30, 2001 in conformity with accounting principles generally + accepted in the United States of America. Also in our opinion, the related fina +ncial statement schedule, when considered in relation to the basic consolida +ted financial statements taken as a whole, presents fairly, in all materia +l respects, the information set forth therein. Melville, New York /s/KPMG LLP September 26, 2001 STR
And the regexp I used was exactly this:
/^\s*(\w+),\s*(\w+ \w+)(.+?\s*LLP)/m
Try it yourself with my regexp tester, here: Perl Regex Tester
Dave
In reply to Re^3: String contents
by davido
in thread String contents
by perlyr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |