You said
The Visual Studio regular expression would find this:
Combined with the title of your question, that makes me think you're trying to do something in a search and replace dialog in Visual Studio, rather than using a regex in an application.
If that's the case, then I think you might be out of luck; Visual Studio's regular expressions aren't very powerful, and they have a rather odd syntax that doesn't seem to be used anywhere else!
My advice would be to either use a different text editor, or use the regex described by SilentGhost in a .NET application (or PowerShell script) to do the replacement for you. When I need to do regex stuff in an editor and Studio doesn't cut it, I tend to use TextPad. It's not very pretty, but it's powerful and has great macro support.
Incidentally, if you want to use PowerShell to do it, this will search foo.js
, and copy the output to fooNew.js
:
(get-content D:\junk\foo.js) -replace
'(?<!function\()someValue', 'someOtherValue' > D:\junk\fooNew.js