Search for two or more words

Tool for Search and Replace across multiple files.
Post Reply
User avatar
Stanley

Search for two or more words

Post by Stanley »

how do I configure regular expressions to search for more than one word

either this word or that word or this word and that word
User avatar
DV

Post by DV »

You can use the | symbol

Regex - hello|goodbye

This searches for hello or goodbye.
User avatar
Stanley

Post by Stanley »

Thanks that worked�

()
User avatar
Stanley

Post by Stanley »

Thanks that worked�

()
User avatar
Stanley

Post by Stanley »

Thanks that worked
How can I use this syntax to perform a search that shows only the results with both words in a file?
If both words do not exist in the file it should not be shown
Example: Hello and goodbye

Is there a list of examples with the proper syntax?
User avatar
DV

Post by DV »

(hello[\s\S]*goodbye)|(goodbye[\s\S]*hello)

The above will find files with both words in. You wouldn't use it to replace though as it would replace everything between the words as well.

The TextCrawler docs list the syntax (Help menu), but for more friendly examples of regular expressions you could try here - http://www.regular-expressions.info/tutorial.html

Remember the reg ex test tool is textcrawler is handy for trying things out.
User avatar
Vikas

Post by Vikas »

How can search
to_char(<variable>,'000');
User avatar
james

Post by james »

This will do it:

(Regular Expression mode)

to_char\((.*),'000'\);
Post Reply