A few basic characters can go a long way. A number of the most widely used characters and operators introduced in this section are summarized in the following table:
Description |
Character |
Example |
Literal character |
Any, except: [\^$.|?*+() |
'a' -match 'a' |
Any single character (except carriage return, line feed, \r, and \n) |
. |
'a' -match '.' |
The preceding character repeated zero or more times |
* |
'abc' -match 'a*' 'abc' -match '.*' |
The preceding character repeated one or more times |
+ |
'abc' -match 'a+' 'abc' -match '.+' |
Escape a character's special meaning |
\ |
'*' -match '\*' '\' -match '\\' |
Optional character |
? |
'abc' -match 'ab?c' &apos... |