Escape special characters
suggest changeA regex uses special characters. . means any character, and + means one or more.
To match those characters literally, escape them with a backslash (\). To match a plus sign, use the pattern \+.
[regex]::Escape() escapes every regex special character in a string:
> [regex]::Escape("(foo)")
\(foo\)
> [regex]::Escape("1+1.2=2.2")
1\+1\.2=2\.2
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents