RegEx Match for "Not Valid HTTP Status Code"

I need help creating a proper regular expression that that will trigger a ‘test as step’ only when invalid or no HTTP response code is detected.

We are trying to scan some sites, then log the HTTP status code + domain to a Google sheet.
For most sites this works fine; but when a domain is no longer live, it returns code “0” in the test, and shows as "returned value “” " in the conditions.

The goal of the flow/steps is:

  1. Get HTTP Status Code
  2. If HTTP Status Code NOT one of {valid status code array} then run alternate test.

The problem is that some sites are returning “0” or “”

I have used regular expression; which validates properly on regexr.com but it does not work in the step.

RegEx:
\b(?=\w)(?!(10[0-2])|(2(0[0-8]|26))|(30[0-8])|(4(0[0-9]|1[0-8]|2[1-4689]|31|44|51|99))|(5(0[0-8]|1[0-1]|99)))\b(\w*)

Is this invalid? Can someone suggest an alternate expression?

Hi @jordan2,
Please try to use this regex and let me know if it works/fits your intention ^[1-9][0-9][0-9]?$|^$

That seems to have done the trick! Thanks a ton, Ran!

You are welcome.
Always glad to help :slight_smile: