Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: how to check whether a particular word exists in filename

by Happy-the-monk (Abbot)
on Jul 03, 2013 at 19:22 UTC ( #1042259=note: print w/ replies, xml ) Need Help??


in reply to how to check whether a particular word exists in filename

I want only .txt should display not A1.txt, how can i exclude the that

* is a quantifier in regex, you probably did not mean to use it there.

This might do: if ( $file =~ m/^CHECK.*\.txt$/ and $file !~ m/A1\.txt$/ ) { ...

!~ to negate the "A1.txt" part.

Cheers, Sören

(hooked on the Perl Programming language)


Comment on Re: how to check whether a particular word exists in filename
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2015-07-04 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls