Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Regex \. help

by codz67 (Initiate)
on Nov 24, 2014 at 19:59 UTC ( #1108281=note: print w/replies, xml ) Need Help??


in reply to Re^3: Regex \. help
in thread Regex \. help

#!/usr/bin/perl @filename = `ls | grep "^regex\.[0-9]"`; print @filename; ...

prints regex.1. I need it to print regex and regex.1:

#!/usr/bin/perl @filename = `ls | grep "^regex\.?[0-9]"`; print @filename;

Doesnt print anything.

Shouldnt the ? match the . zero or more times? If so why doesnt it print regex and regex.1 As for the .abc I need that to be excluded when it greps. So regex.abc and regex.xyz wont print.

Thank you for the help so far, I am still stuck on making this work. I will continue to try to make this work, if anyone could assist further I would be very thankful.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (1)
As of 2022-10-02 15:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (11 votes). Check out past polls.

    Notices?