Community Patterns

Community Library Entry

3

Regular Expression
Created·2014-10-10 13:35
Flavor·PCRE (Legacy)

/
(?=\{((?:[^{}]++|\{(?1)\})++)\})
/
Open regex in editor

Description

This regex fetch only the data between content in curly braces (first occurrence, use preg_match_all in php, for all occurrences). This is useful for bad JSON files with wrong format or text between.

Submitted by shakaran87