yv-9dq
Last Updated: February 25, 2016
·
534
· ashiguruma
C6b33788d5d2de4533488f8707026748

RegEx to replace function with it's argument

Sometimes JSON output can contain values that are functions. The best way to overcome this is to actually export the data properly so it's actually JSON. Should that not be possible, this regex will help you replace things like:

{"dateCreated": ISODate("2013-07-19T15:32:56.049Z")}

with

{"dateCreated": "2013-07-19T15:32:56.049Z"}

In your text editor find this:

function_name[^(]*\(([^)]*)\)

Replace this:

$1

NB: This doesn't work for multiple arguments

Say Thanks
Respond