Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Regex to detect file name

by Marshall (Canon)
on Jul 05, 2018 at 19:09 UTC ( [id://1217986]=note: print w/replies, xml ) Need Help??


in reply to Regex to detect file name

The Perl regex "shortcut" for A-Za-z0-9 is "\w".

Show a bit more examples and the Monks will help you write an appropriate regex.

Replies are listed 'Best First'.
Re^2: Regex to detect file name
by Laurent_R (Canon) on Jul 05, 2018 at 21:33 UTC
    The Perl regex "shortcut" for A-Za-z0-9 is "\w".
    Yes, this shortcut is probably good enough for the case in point. But, without wanting to nitpick, let me just add that \w also matches the underscore ( _). This would be anecdotic in most cases, but it seems that the OP does not want the string to start with an underscore.
      and unicode
        and unicode
        yes, indeed. ++

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-25 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found