in reply to Re: Matching quoted variables. Cant make it work..
in thread Matching quoted variables. Cant make it work..
As you rightly pointed out.. quotemeta($a) is what I was really looking for, but missed it. Too many languages in my head.. F77,lisp,skill,c,tcl,perl,csh,ksh.......etc etc. I knew I wanted to 'quote' the contents of the variable to prevent regex interpretation, but didn't see how.
And yes, everyone is correct, that in the example I chose to show, the matching is redundant and 'eq' or index() is a better choice. But once I got stuck on the problem I wanted to understand the generalities of quoting & regex with variables for future use.
Thanks to everyone, I can see clearly now ...
|
|---|