Search code examples
javascriptregexlookbehind

how to match any string but not a string that starts with slash?


how to match any string but not a string that starts with a slash?

I'm using node js regex

that was my try but it didn't work

(?!\/s).*

Solution

  • ^[^\/] match everything except that starts with slash

    ^[^\/].* if you want to match the whole string