Regexp fails if pattern is blank

I’m not totally sure if this is a bug, expected behaviour or what, but it seems that if you match a string against a blank regular expression, an exception is raised.

I had kind of thought any string matched a blank pattern (effectively you’re not imposing any requirements on the string at all). I could be wrong though.

Steve

When you say an exception is raised, do you mean an unhandled one in an action? Cos if so that’s definitely a bug.

A blank regular expression pattern matches nothing, because the regexp engine makes no matches. [.\r\n]* matches anything.

Sorry, not sure of my terminology, but it just creates a build-level exception - the build is stopped, and an error generated for that step.

So, probably behaving as expected.

Steve

Hi Steve,

Oh, OK. I wasn’t sure if you were talking about a build action (Text Find / Replace) or maybe some script.

- Angus

In this case, an “If … matches regular expression” step.

(incidentally, these critical errors in the forum software are getting over the top…couldn’t reply at all except through “Quick reply”. I reported this in the forum issues forum…)

Steve

Hi Steve,

We’ll see what we can do about it. Most of the time clicking Refresh should work.

- Angus