in reply to Including "End of String" in character class?
If you extend what you already have,
$line =~ m/StreamTitle='(.*?)(?:'|\z)/i;
or just
$line =~ m/StreamTitle='(.*?)'?/i;
However, if you replace the .*? with the more predictable [^']*, you don't even have to match the end quote:
$line =~ m/StreamTitle='([^']*)/i;
Update: I knew I avoided .*? for a reason. Struck out a bad "solution".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Including "End of String" in character class?
by doran (Deacon) on Mar 16, 2007 at 19:31 UTC |