Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Regex to detect file name

by Laurent_R (Canon)
on Jul 05, 2018 at 21:56 UTC ( [id://1218006]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Regex to detect file name
in thread Regex to detect file name

Hm, I think I understand the problem. The OP's regex:
if($view_tag =~ m/[^A-Za-z0-9_\-\.]/) {
actually has a negative character class (leading ^), rather than a start-of-string anchor.

So the OP had to negate the pattern.

My guess is that the OP really meant:

if($view_tag =~ m/^[A-Za-z0-9_\-\.]/) {
Update: fixed a typo: s/or-string/of-string/

Replies are listed 'Best First'.
Re^5: Regex to detect file name
by AnomalousMonk (Archbishop) on Jul 06, 2018 at 01:14 UTC
    My guess is that the OP really meant ...

    My guess is that your guess is probably pretty good, but lirc201 is the only one who can clear this up and I doubt we'll hear much more from that quarter. I guess this is just another mystery to be filed in the big, empty drawer labeled X. :)


    Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-25 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found