Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Glob to Regex issue

by SuicideJunkie (Vicar)
on Nov 18, 2015 at 15:16 UTC ( [id://1148027]=note: print w/replies, xml ) Need Help??


in reply to Glob to Regex issue

If the text in your source file is <"\\[">, then your string becomes <\[> and your regex looks for a literal <[>

If the text in your source file is <"\[">, then your string becomes <[> and your regex sees the start of a character class.


OR, you can use single quotes to avoid the interpolation:

If the text in your source file is <'\\['>, then your string becomes <\\[> and your regex looks for a literal <\[>

If the text in your source file is <'\['>, then your string becomes <\[> and your regex looks for a literal <[>


If you are typing it as a one-liner into the command prompt, then you'll need twice as many backslashes of course.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1148027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-16 17:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found