Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: perl system command

by cbtshare (Monk)
on Nov 10, 2016 at 16:04 UTC ( [id://1175683]=note: print w/replies, xml ) Need Help??


in reply to Re^3: perl system command
in thread perl system command

thank you , I will look at your code .Yes, I wanted feed and any words or digits after, because there is "feed001, feed002" etc

Replies are listed 'Best First'.
Re^5: perl system command
by AnomalousMonk (Archbishop) on Nov 10, 2016 at 19:37 UTC
    ... I wanted feed and any words or digits after ...

    /d*/ matches zero or more  'd' characters, but does not match "words" (unless they're composed only of  'd' characters) and certainly not decimal digits. Perhaps you want something like  /feed[[:alnum:]]*/

    c:\@Work\Perl\monks>perl -wMstrict -le "for my $str (qw( feed feeder feed001 xfeed001x fee fee001 xfeex --fee-- fe xxx 001 )) { print qq{'$str' -> }, $str =~ m{ feed [[:alnum:]]* }xms ? '' : 'NO', ' match'; } " 'feed' -> match 'feeder' -> match 'feed001' -> match 'xfeed001x' -> match 'fee' -> NO match 'fee001' -> NO match 'xfeex' -> NO match '--fee--' -> NO match 'fe' -> NO match 'xxx' -> NO match '001' -> NO match
    Change the match pattern above to just  feed* to see the difference.


    Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-29 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found