#!/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. |