Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^7: How to look for two different file extensions?

by demerphq (Chancellor)
on Mar 23, 2017 at 19:40 UTC ( #1185671=note: print w/replies, xml ) Need Help??


in reply to Re^6: How to look for two different file extensions?
in thread How to look for two different file extensions?

There is *always* more than one way to do it. That doesn't mean every post should contain all of them. In particular throwing out a regexp with non-basic syntax but no explanation doesn't seem like it will make things clearer for the novice.

There are regexes in the OP's code, and regexes are a pretty core part of "thinking perl", so i think /AN/ answer including regex would be useful. But at the same time, how helpful is it to complain about someone elses answer like that? Why not just make a post with an explanation? Anyway.

So heres an explanation:

$FileExt =~/ # "file extension matches ...." \A # the start of the variable \. # match a literal dot (?: # begin a set of options foo # the option itself | # OR bar # another option ) # end of option group \z # end of variable /x; # end of pattern, enable comments in the r +egex
---
$world=~s/war/peace/g

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2020-09-28 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (144 votes). Check out past polls.

    Notices?