# Regexp fails if pattern is blank

**URL:** https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721
**Category:** Bugs
**Created:** [November 30, 2006, 1:16am UTC](https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721 "2006-11-30T01:16:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [November 30, 2006, 1:16am UTC](https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721/1 "2006-11-30T01:16:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [November 30, 2006, 1:25am UTC](https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721/2 "2006-11-30T01:25:34Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [November 30, 2006, 1:42am UTC](https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721/3 "2006-11-30T01:42:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [November 30, 2006, 1:48am UTC](https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721/4 "2006-11-30T01:48:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [November 30, 2006, 2:51am UTC](https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721/5 "2006-11-30T02:51:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [November 30, 2006, 3:08am UTC](https://www.finalbuilder.com/forums/t/regexp-fails-if-pattern-is-blank/2721/6 "2006-11-30T03:08:29Z")

</div>

Hi Steve,  
  
We’ll see what we can do about it. Most of the time clicking Refresh should work.  
  
- Angus
