Last Updated: February 25, 2016
· ashiguruma

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")}


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

In your text editor find this:


Replace this:


NB: This doesn't work for multiple arguments

Awesome Job

Frontend Web Developer for Games
Leamington Spa (United Kingdom)
Full Time