Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Find all strings containing "a" characters, that are not followed by "b" characters.

by johngg (Abbot)
on Dec 12, 2012 at 23:39 UTC ( #1008611=note: print w/replies, xml ) Need Help??


in reply to Re: Find all strings containing "a" characters, that are not followed by "b" characters.
in thread Find all strings containing "a" characters, that are not followed by "b" characters.

A look-ahead is fine, you just have to insert .* (zero or more of anything) before the "b" I think.

$ perl -E ' > say qq{$_ - @{ [ m{a(?!.*b)} ? q{Match} : q{No match} ] }} for ( > q{Have you any fish}, > q{What a nice broom}, > q{Fishing for trout}, > );' Have you any fish - Match What a nice broom - No match Fishing for trout - No match $

I hope this is of interest.

Cheers,

JohnGG

  • Comment on Re^2: Find all strings containing "a" characters, that are not followed by "b" characters.
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008611]
help
Chatterbox?
[GotToBTru]: I suppose the actual details about what is necessary to actually do something is kept fuzzy deliberately
[LanX]: the interview was with the guy who designed the process
[LanX]: in the 70s
[GotToBTru]: so the font on the card is probably NOT Comic Sans
[GotToBTru]: that's a relief
[LanX]: Bruce_G._Blair
[choroba]: as in embossed card?
[Discipulus]: ironically from his pubblications: "Can Disarmament Work?"
[erix]: when is the bird-brain's inauguration tweet?

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2017-01-20 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.