Regular Expressions 101

Community Patterns

Match Single Line (//) Comments in JSON

1

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

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

Submitted by Redu - 2 months ago (Last modified 2 months ago)