Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-11-04 20:42
Flavor·PCRE (Legacy)

/
([a-zA-Z0-9\_]*)\:\s?([A-Za-z0-9\"\']*)
/
mg
Open regex in editor

Description

This will allow you to swap key and value in a JavaScript object. So { language: "romanian" } will become { romanian: "language" }

Submitted by Victor