delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

com but not @hotmail.com
How can I  do that  in all one expression, Like you do pipe in unix


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

TOP


Code:
  1. /(yahoo\.com|[^@]*hotmail\.com)/
Copy Code
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!

TOP

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

TOP

Try
Code:
  1. (yahoo\.com|[^@]hotmail\.com)
Copy Code




com but not @hotmail.com
How can I  do that  in all one expression, Like you do pipe in unix

TOP

Back Forum