Need help with regular expression (regex) for IP ranges

I am attempting to use IP ranges for secrets, but can’t get the regex to work.

However, it doesn’t match in the extension, by autodetect or by manual search.

Any assistance would be appreciated.

How it appears when trying to match

Hi @JTAT,

this one ^https:\/\/10\.192\.227\.(119|1[23]\d|140):8443 should work for your scenario. The obvious error was the $, as the URL-string does not end with the port.

The last octet is a bit tricky, but nothing you wouldn’t solve with playing around in https://regex101.com/. Remember to set the parser to ECMAScript (Javascript)

Kind regards,
Daniel

1 Like

Thank you for the assist and the resource