Wagner, David --- Senior Programmer Analyst --- WGO wrote: > > [EMAIL PROTECTED] wrote: >> I am trying to do write a search comparison between to part >> numbers.... >> >> $found = 1 if $string1 =~ /$string2/g; >> > If there can be reqex operators within the variable > then you need to tell regex to not expand, so you would do > something like: > $found = 1 if $string1 =~ /\Q$string2\E/g; > Now when it finds an * it is just coig to use as an > asterick and not one or more occurances of the preceding character(s).
An alternative is the quotemeta function (See perldoc -f quotemeta). Also why use the 'g' switch? It looks redundant to me. HTH -- Brian Raven ----------------------------------------------------------------------- The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary companies. ----------------------------------------------------------------------- _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
