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
In reply to Re: Traping [** using reg exp
by VSarkiss
in thread Traping [** using reg exp
by blackadder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |