Regular Expressions 101

Match double quoted or single quoted multi line string in code.

Open Workspace
  • Python
  • Substitution
0

Regular Expression

r"""
("|')((?!(?!\\)(\1|\n))|(\\(.|\n))|((?!\\).))*?(\1)
"""
g

Description

This will allow for valid string parsing via a regex in popular interpreted languages like Lua, Python and Ruby.

Submitted by Siddharth Gupta