Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2017-05-31 20:07
Flavor·PCRE (Legacy)

`
(?|(\[[\"]?.+?[\"]?\])(=>)\R\s*|(?<=\(0\) )(\{)\R\s*(\}))
`
g
Open regex in editor

Description

The PHP function var_dump() provides debugging output, but has more line-breaks than is needed for readability. This regex strips out the (in my eyes) unnecessary line-breaks. Good in a self written debugging method in combination with ob_start()and ob_get_contents().

Submitted by Doqnach