I have the following string:
my-name-host1.host2.host3.com:80
I'm looking for a regex which matches everything until the string -host1.host2.host3.com:80
, i.e. the result shall be:
my-name
My current regex in JavaScript seems to be working. The problem is that I need this regex in a "Golang flavor".
https://regex101.com/r/ebSTuq/1
When switching it to Golang I get this regex with a pattern error:
.*(?=\Q-host1.host2.host3.com:80\E)
The preceding token is not quantifiable.