Match literal text

Problem

Math these literal

1
The punctuation characters in the ASCII table are: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

Solution

1
2
The●punctuation●characters●in●the●ASCII●table●are:●↵
!"#\$%&'\(\)\*\+,-\./:;<=>\?@\[\\]\^_`\{\|}~
  • Regex options: None
  • Regex flavors: .NET, Java, JavaScript, PCRE, Perl, Python, Ruby
1
$()*+.?[\^{|
  • these characters is key words, only matches itsself
  • ‘]’ and ‘}’ is not

Variations

1
2
The●punctuation●characters●in●the●ASCII●table●are:●↵
\Q!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\E
  • Regex options: None
  • Regex flavors: Java 6, PCRE, Perl

use \Q \E to suppresses the meaning
of all metacharacters, including the backslash


Case-insensitive matching

Outside the regex
ascii

  • Regex options: Case insensitive
  • Regex flavors: .NET, Java, JavaScript, PCRE, Perl, Python, Ruby

Inside the regex
(?i)ascii

  • Regex options: None
  • Regex flavors: .NET, Java, XRegExp, PCRE, Perl, Python, Ruby