in reply to Regex match last
Alternate:
C:\>perl -E "my $str='<c:t="AD2343"/><c:p>65677676</c:p>'; if ( $str = +~ m|(<c:.*)?(?:[/>]{2})| ) {say $1;}" <c:t=AD2343
Your code asks the regex engine to match a 'c', a colon and any number of anything thereafter(except newlines).
Because you didn't provide the actual code, we can't be sure just what other issues may be in play... such as the previously mentioned use of an alternate regex marker.
Update (based on the redefined problem in Re^2: Regex match last): You'll probably have fewer problems in the long run if you use an html parser of one flavor or another, rather than trying to parse html with regexen.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex match last
by Anonymous Monk on Aug 20, 2012 at 10:55 UTC | |
by Neighbour (Friar) on Aug 20, 2012 at 11:35 UTC | |
by ww (Archbishop) on Aug 20, 2012 at 14:09 UTC |