Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

(elbie): "everything but" regex

by elbie (Deacon)
on Aug 17, 2001 at 01:15 UTC ( #105525=note: print w/ replies, xml ) Need Help??


in reply to Re: "everything but" regex
in thread "everything but" regex

Note that if your string does not contain 'whatever', then HyperZonk's second regex will return nothing.

I'm going to go out on a limb here, as regexes are not my thing, but this might just work:

$string =~ /^((.*?)(whatever))*(.*)$/;

However to be perfectly honest, I've no idea which $1, $2, $3, etc will be the values you want, or even if the regex is correctc.

I seem to have bitten off a bit much. Can somebody help?

elbieelbieelbie


Comment on (elbie): "everything but" regex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2015-07-29 09:48 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 (263 votes), past polls