Find and replace wildcard characters
to find |
type |
Example |
Any single character |
? |
S?t can find "sat" and "set". |
Arbitrary string |
* |
S*d can find "sad" and "started". |
The beginning of a word |
< |
< (inter) can find "interesting" and "intercept", but cannot find "splintered". |
The end of a word |
> |
> can find "in" and "within", but cannot find "interesting". |
One of the specified characters |
[ ] |
W[io]n can find "win" and "won". |
Any single character within this range |
[-] |
[R-t]ight can find "right" and "sight". The range must be ascending. |
Any single character other than the characters in the range within the parentheses |
[!x-z] |
T[!a-m]ck can find "tock" and "tuck", but cannot find "tack" or "tick". |
N repeated previous characters or expressions |
{n} |
Fe{2}d can find "feed", but cannot find "fed". |
At least n first character or expression |
{n,} |
Fe{1,}d can find "fed" and "feed". |
N to M first character or expression |
{n,m} |
10{1,3} to find "10", "100" and "1000". |
One or more of the preceding characters or expressions |
@ |
[email protected] to find "lot" and "loot". |
find two words: (<*>) space (<*>) "This is a text" can be found "This is" "is a" "a text" followed by a space to find
an asterisk (*) returns all the text in the word.
(< >) marks the beginning and end of each word, respectively. Returns a single word.
the brackets and spaces between them split the word into different groups: (the first word) (the second word).
to be replaced by: \2, \1 "is, this"
a slash (\) is placed together with a number to act as a placeholder. (You can also use a slash to find other wildcard characters.) See the next section for more information. )
Find two words: (<*) spaces ([! Space]@) ^13 found: "The beginning of this is a text line break"
To be replaced by: \2, Space \1^p "text, this is a"
28th May 2003
Lookup: ([0-9]{1,2}) ([Dhnrst]{2}) space (<[ADFJMNOS]*>) space ([0-9]{4})
Replace: \3 space \1, Space \4 May, 2003
Wildcard characters for Word find and replace