Regular Expressions 101

Community Patterns

Detect JSON entries

1

Regular Expression
PCRE (PHP <7.3)

/
\"(.*?)[^\\\"]\"\:
/
gm

Description

This Regexp here has probably been done a ton of times, but I kind of figured one out here, so I decided to post it anyways. It may or may not be a duplicate, but this also will ignore any strings that a JSON entry may have so that it knows not to detect something if a value contains text like "something":

That was probably confusing, but enjoy.

Submitted by Ghostyrun - 6 years ago