home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Regular Expressions

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1981
Discussions: 200,936, Posts: 2,379,233, Members: 246,301
Old November 5th, 2004, 04:35 PM   Digg it!   #1 (permalink)
Senior Member
 
omalleytrading's Avatar
 
Join Date: Apr 2003
Location: Albany, NY
Posts: 623
Regular Expressions

Can anyone help me with a regular expression?

It's very easy to match on a given word. For example:

/(cat|dog|mouse)/g would match on the word "cat", "dog" or "mouse".

What I want, however, it to match on the opposite -- everything that's not cat, dog or mouse.

Any ideas??

Last edited by omalleytrading : November 5th, 2004 at 04:37 PM.
omalleytrading is offline   Reply With Quote
Old November 7th, 2004, 04:28 PM     #2 (permalink)
Member
 
quux's Avatar
 
Join Date: Nov 2002
Location: Hamburg
Posts: 244
Non-trivial indeed.

quote from: http://www.perl.com/doc/FMTEYEWTK/regexps.html ...

"... You can do tricks like using [^:] or [^"] or [^"'] for the simple cases, but negating multicharacter strings is hard. You can just use stingy matching instead.

Or you could just use lookaheads. "

CC.
__________________
*** all that we C or Scheme is
but a dream within a dream ***
quux is offline   Reply With Quote
Old November 7th, 2004, 05:38 PM     #3 (permalink)
Senior Member
 
omalleytrading's Avatar
 
Join Date: Apr 2003
Location: Albany, NY
Posts: 623
Thanks for the link.

I'm not encouraged by the "negating multicharacter strings is hard" part though...
omalleytrading is offline   Reply With Quote
Old November 9th, 2004, 11:11 AM     #4 (permalink)
Member
 
quux's Avatar
 
Join Date: Nov 2002
Location: Hamburg
Posts: 244
In the meantime ...

... there was an article on ./ linking to

IBM developerworks .

Looks promising.

CC.
quux is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Samurize ClubMed IMO Community 20 July 21st, 2003 12:54 AM
americas army problem... cracked General Gaming Discussion 3 May 5th, 2003 10:14 PM
Perl RegExp vass0922 Webmastering and Programming 16 October 20th, 2002 08:23 PM
Unix: extracting 3letter words only NeoStarO1 Applications and Operating Systems 8 July 26th, 2002 03:05 AM
Picky, but a suggestion just the same blinking-curser Suggestion Box 2 March 7th, 2002 04:35 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
windows 7 problem (6)
Is It Just Me? (2899)
Wireless Televisions. (8)
California Passes Anti-Flat-HDTV Le.. (41)
Obama the Muslim (14)
Is the PSU I received dead? (10)
windows vista security holes (9)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (11)
Print spooler problem (13)
Foreign voltage (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
EVGA 9800 gtx help with finding a g.. (8)
Recent Discussions
Have you switched yet? (85)
Regular Build (4)
windows 7 problem (6)
Point and Shoot Camera Suggestions. (2)
Modern Warfare 2 freeze (13)
Wireless Televisions. (8)
CPU fan stops spinning randomly (3)
wireless user (1)
World's largest Monopoly Game using G.. (332)
Ideal cheap graph card for PC-Gaming? (17)
BIOS won't read disk when I try to fl.. (0)
Install XP pro and a Vista laptop ?? (11)
Partition Magic caused HDD problem (2)
Graphics Card Upgrade Question (1)
favorit (1)
solutions for virtical white lines on.. (1)
Fire in DVD (2)
Modern Warfare For the PC (33)
radeon x850xt platinum & shader 3 (3)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)


All times are GMT -4. The time now is 11:29 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28