Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1042259]
[Discipulus]: I havery limited needs in such field. Sometimes (for children party invitations) i draw something by hand and I scan it to include into an ms doc.
Discipulus havery can be a good neologism for: have very..;=)
[ambrus]: Discipulus: sure, it's just that, look, some people (including me) have such unreadable and slow handwriting that writing an article or slides by hand would be a very bad idea.
[choroba]: it might bery useful for other verbs, too
[ambrus]: (and I have a need for at least decent formatting too)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-09-26 11:28 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (293 votes). Check out past polls.