# Error in if.. with regular Expression

**URL:** https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096
**Category:** Bugs
**Created:** [April 19, 2009, 2:26am UTC](https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096 "2009-04-19T02:26:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 19, 2009, 2:26am UTC](https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096/1 "2009-04-19T02:26:28Z")

</div>

Hi   
 I want to use if … then with a regular expression.   
 I can run the test that u sent FilesetExample.fbz6.zip.   
 The example works fine, but there is a problem when I try such an expression inside my script.BTW if I try just .\* it works, but when I add more things it fails like this:   
  
  
 Expression:   
 If ( %TEMP\_STRING\_3% matches RegExp ._\bin\._ )   
 Expanded Values:   
 Error expanding Term 1 left hand value : Variable : CurrentSolutionConfigurationContents - does not exist!   
  
 Thanks   
 Daphna Levin

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [April 20, 2009, 2:22am UTC](https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096/2 "2009-04-20T02:22:20Z")

</div>

Hi Daphna,   
  
 What is the value and the type of the variable ‘%TEMP\_STRING\_3%’? From the error it look’s like it’s a macro variable and it references the unused variable ‘%CurrentSolutionConfigurationContents%’.   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 20, 2009, 9:46am UTC](https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096/3 "2009-04-20T09:46:00Z")

</div>

%TEMP\_STRING\_3% Is a String Variable that I use. (It Contains the output of the action MsBuild Project- The outPut that I Want to process)   
 The variable '%CurrentSolutionConfigurationContents% is not mine.   
 As I mentioned before, it worked when the Regular expression is .\* But when I try something more complex I get this error. So the problem is probably the interaction with the action – MsBuild Project.   
 Thanks Daphna

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [April 21, 2009, 12:40pm UTC](https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096/4 "2009-04-21T12:40:08Z")

</div>

Hi Daphna,   
  
 You’ll need to use %!TEMP\_STRING\_3% instead of %TEMP\_STRING\_3% in the If…Then action so that it’s not recursively expanded. This will prevent the action from attempting to expand all the variables within the TEMP\_STRING\_3 variable.   
  
 Regards,   
 Paul.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [April 21, 2009, 11:11am UTC](https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096/5 "2009-04-21T11:11:31Z")

</div>

Thanks, it solved the problem.   
 BTW - is there a Help section where this is explained??   
  
 Daphna

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [April 22, 2009, 12:00pm UTC](https://www.finalbuilder.com/forums/t/error-in-if-with-regular-expression/3096/6 "2009-04-22T12:00:08Z")

</div>

Here’s the relevant help section: [https://www.finalbuilder.com/finalbuilder/Help/HTML/escaping\_variable\_contents.htm](https://www.finalbuilder.com/finalbuilder/Help/HTML/escaping_variable_contents.htm)
