Regex Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreRegex Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 22nd, 2008, 12:57 PM
isheikh isheikh is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 595 isheikh Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 15 h 23 m 38 sec
Reputation Power: 0
Basic regex help needed

Hi,

I am using 'Edit Plus 'directory search option. I don't know much about Regex
I need to write regex which gives me when ever there is word yahoo.com and hotmail.com but not @hotmail.com

How can I do that in all one expression, Like you do pipe in unix
__________________
web developer

Reply With Quote
  #2  
Old August 22nd, 2008, 01:29 PM
derelict's Avatar
derelict derelict is offline
garish grotesque gargoyle
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2006
Location: gracing gargantuan gothic gateways
Posts: 1,337 derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level)derelict User rank is General 1st Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Weeks 6 Days 8 h 35 m 8 sec
Reputation Power: 1036
Code:
/(yahoo\.com|[^@]*hotmail\.com)/



would be containing yahoo.com or hotmail.com but not @hotmail.com

would also match @yahoo.com

the | operator says 'or'; if you put the whole phrase in a match condition (the () operators) then it's one phrase or the other. the [^something] syntax says 'not any character in these []'. the * operator says '0 or more', so that if the string starts with hotmail.com it will still match.

try checking the other threads in the regex forum for some really helpful info about using regex in general, it will teach you a lot about the syntax and how to use it. good luck!
__________________

"Human history becomes more and more a race between education and catastrophe." (H.G. Wells)
"Giving me a new idea is like handing a cretin a loaded gun, but I do thank you anyhow, bang, bang." (Philip K. D!ck)

Reply With Quote
  #3  
Old August 25th, 2008, 01:44 PM
isheikh isheikh is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 595 isheikh Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 15 h 23 m 38 sec
Reputation Power: 0
Thanks for your help, I tested, it did not work, I put that regular expression in editPlus find box. I was searching a simple file that had yahoo.com and hotmail.com but I got the message "Can not find string" I am attachimng the snapshot
Attached Images
File Type: jpg regex.JPG (34.7 KB, 237 views)

Reply With Quote
  #4  
Old August 25th, 2008, 02:07 PM
ptr2void ptr2void is offline
I haz teh codez!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Dec 2003
Posts: 2,476 ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 5 h 42 m 39 sec
Reputation Power: 2194
Try
Code:
(yahoo\.com|[^@]hotmail\.com)
__________________
I ♥ ManiacDan & requinix

This is a sig, and not necessarily a comment on the OP:
Please don't be a help vampire!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreRegex Programming > Basic regex help needed

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap