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 but it does not work in the step.


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: