As said in Regex: match everything but in order to match everything but a string, you can use ^(?!foo$).*
As seen here https://regex101.com/r/9khSXB/2
But this doesn't work when using https://www.npmjs.com/package/path-to-regexp specifically within ReactJS Routing (error -> invalid path)
<R.Route path="/^(?!\/whatsmyname$).*" render={() => <div>works!</div>} />
(also seen here http://forbeslindesay.github.io/express-route-tester/)
How can I write this regex in a node-friendly style?
UPDATE: this does work, you need the curly braces
<R.Route path={/^\/(?!whatsmyname$).*/} render={() => <div>works!</div>} />