Regex to match if string doesn’t start with a substring – Getting Help


I know that Go is handling regex with lookahead a little differently. What I’m trying to do is, I want to match everything that doesn’t start Test_integration_, it’s really easy ^(?!Test_integration_)\w+$ But with Go it’s not that easy. how do i do this please?

Note: I don’t mind a solution that “doesn’t terminate” if it’s simple.

Thank you

This is ok because it runs all tests starting from Test_integration_,

go test -v -run Test_integration_ ./some/package/

This should run all tests except those mentioned above.

go test -v -run ????? ./some/package/

Thank you

Leave a Comment