Regular Expressions 101

Match Single Line (//) Comments in JSON

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

/
(?<![:\/])\/\/.*$
/
gm

Description

Doesn't get confused by the url values like "https://www.example.com " or "file:///some.txt"

Submitted by Redu