in reply to Traping [** using reg exp
If it's a fixed string, don't bother with a regex at all. Just use substr:
Which depends on the fact that a negative second argument to substr counts from the end of the string.my $target = '[**REQUIRES USER CONTEXT**]'; my $len = length $target; # or just count it yourself ;-) # later... print if substr($item, -$len, $len) eq $target;
HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Traping [** using reg exp
by blackadder (Hermit) on Sep 09, 2004 at 10:04 UTC |