in reply to Traping [** using reg exp

If it's a fixed string, don't bother with a regex at all. Just use substr:

my $target = '[**REQUIRES USER CONTEXT**]'; my $len = length $target; # or just count it yourself ;-) # later... print if substr($item, -$len, $len) eq $target;
Which depends on the fact that a negative second argument to substr counts from the end of the string.

HTH

Replies are listed 'Best First'.
Re^2: Traping [** using reg exp
by blackadder (Hermit) on Sep 09, 2004 at 10:04 UTC
    This is very good alternate method if need be - it did cross my mind - but I'll carry on with the reg exp for now,....Thanks for this...Regards
    Blackadder