Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.

Make a string regexp-safe

by pm5 (Acolyte)
on Jul 14, 2002 at 15:36 UTC ( [id://181580]=perlquestion: print w/replies, xml ) Need Help??

pm5 has asked for the wisdom of the Perl Monks concerning the following question:

Recently I've found several bugs in my system in development that are related to hidden regexps in a string. In these works coping with big5 environment, often there comes data strings that includeds regexp operators: '|', '\', etc. Once I s/// they first, the bugs are vaporized.

I prepare to delegate these work-outs to a module so that further refinements can be aggregated. But first I'd like to know is there any other way to do this? As I haven't catched up with developments in locale yet, I don't know if this issue will be epitaph by 5.8. And I've check several modules related to string escaping in my memory, but they all emits code in particular format, ex. URI, Base64, instead of the desired '\|', '\\' construct.

Some guidence is appreciated. Thanks in advanced.

Replies are listed 'Best First'.
Re: Make a string regexp-safe
by stefp (Vicar) on Jul 14, 2002 at 15:56 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://181580]
Approved by vagnerr
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-12 19:01 GMT
Find Nodes?
    Voting Booth?

    No recent polls found