regexwildcard

Regular Expression with wildcard for string of characters


I read some of the answers but still cannot get the slashes right to be able to find all instances of the below text, no matter what the date/time is, to be replaced fully with new value.

"expire_time" : ISODate("1970-01-01T00:00:00.000+0000"),

So essentially I want to find where:

"expire_time" : ISODate("*anything here*"),

and then replace the full string with new value. This is just the find/replace feature in notepad++


Solution

  • This should work.

    "expire_time" : ISODate\("[^"]*"\),
    

    You need to escape ( and ) because they have special meaning in regular expressions.

    [^"] matches any character other than ", so [^"]* matches anything inside the quotes.