# Search/replace text changes after save

**URL:** https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781
**Category:** Bugs
**Created:** [February 15, 2007, 8:13am UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781 "2007-02-15T08:13:58Z")
**Posts on this page:** 7
**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: [February 15, 2007, 8:13am UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781/1 "2007-02-15T08:13:58Z")

</div>

I need to change a string in a file, substituting a different value for the 0.0 in ‘VERSION=&amp;quot;0.0&amp;quot’. If I use Text Replace and match as a regular expression, this string matches: ‘VERSION=\&quot;0.0\&quot’. But if I save my project and restart FinalBuilder, the pattern has been changed to   
‘VERSION=\"0.0\&quot’, which doesn’t match. This appears to be due to the xml format of the save file, causing the &quot; to be replaced with a " when the xml is read from the file.   
  
Any ideas on how I can get this to work across saves & loads?  
  
&nbsp; Thanks,  
  
&nbsp;&nbsp;&nbsp; Keith Hearn  
&nbsp;&nbsp;&nbsp; Devicescape, Inc.

---

<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: [February 15, 2007, 10:59am UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781/2 "2007-02-15T10:59:47Z")

</div>

Adding a little more data to my original post. When I first set up the search/replace and save, here is the xml from the .fbp5 file for the search and replace strings:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VERSION=&amp;amp;amp;quot;%VERSION%&amp;amp;amp;quot  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VERSION=\&amp;amp;quot;0.0\&amp;amp;quot  
  
And after I exit and restart Finalbuilder, I see that the patterns have changed. I then save again and look at the .fbp5 file and they are:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VERSION="%VERSION%&amp;amp;amp;quot  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VERSION=\"0.0\&amp;amp;quot  
  
So &amp;amp;quot; seems to get replaced by " when the xml file is read.   
  
&nbsp; Keith

---

<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: [February 15, 2007, 11:06am UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781/3 "2007-02-15T11:06:07Z")

</div>

Hmmm, some of the lines I was copying from the .fbp5 files in my previous posts got eliminated when I posted (but it was there when I looked at a preview).  
It looks like the forum stripped out the Property tags and end tags in my post, but not when I previewed it.  
  
I’ll try again with backslashes in front of the open angle brackets and see if that works.  
  
The originals lines were:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<property multivalue=“0” name=“ReplaceText” type=“string”\>VERSION=&amp;amp;amp;quot;%VERSION%&amp;amp;amp;quot\</property\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<property multivalue=“0” name=“SearchText” type=“string”\>VERSION=\&amp;amp;quot;0.0\&amp;amp;quot\</property\>  
  
The lines after a read and save were:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<property multivalue=“0” name=“ReplaceText” type=“string”\>VERSION="%VERSION%&amp;amp;amp;quot\</property\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<property multivalue=“0” name=“SearchText” type=“string”\>VERSION=\"0.0\&amp;amp;quot\</property\>

---

<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: [February 15, 2007, 11:09am UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781/4 "2007-02-15T11:09:53Z")

</div>

Nope, that didn’t work either. I’m going to replace the angle brackets with parens. Hopefully that will not get messed up. This would be easier if the preview showed what the actual post ends up showing. 🙂  
  
After first save:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Property MultiValue=“0” name=“ReplaceText” type=“string”)VERSION=&amp;amp;amp;quot;%VERSION%&amp;amp;amp;quot(/Property)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Property MultiValue=“0” name=“SearchText” type=“string”)VERSION=\&amp;amp;quot;0.0\&amp;amp;quot(/Property)  
  
Aftrer a read and re-save:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Property MultiValue=“0” name=“ReplaceText” type=“string”)VERSION="%VERSION%&amp;amp;amp;quot(/Property)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Property MultiValue=“0” name=“SearchText” type=“string”)VERSION=\"0.0\&amp;amp;quot(/Property)  
  
“This time fer sure!” – Bullwinkle Moose

---

<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: [February 15, 2007, 11:47am UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781/5 "2007-02-15T11:47:12Z")

</div>

If your action parameters are getting mangled, one solution may be to use variables to store part of the value. I can’t work out from your above posts what you actually want to store (sorry!) but for example, I had a problem where the trailing space in a field was getting lost. The solution was to create a variable called %Space%, which contained a single character, then make the value of the field “Somevalue%space%”. You may be able to do something similar by storing an ampersand in a variable or something.  
  
Steve

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [February 16, 2007, 12:16pm UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781/6 "2007-02-16T12:16:14Z")

</div>

Keith - looks like a bug in the escaping code for xml… can you please email us the string you are trying to save… that way we can be sure it doesn’t get mangled by the forum software (send to support [at] finalbuilder dot com) thanks.  
  
.t8

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [February 16, 2007, 5:44am UTC](https://www.finalbuilder.com/forums/t/search-replace-text-changes-after-save/2781/7 "2007-02-16T05:44:23Z")

</div>

fixed! new build is:  
  
[https://www.finalbuilder.com/downloads/finalbuilder/500/FB500\_128.exe](https://www.finalbuilder.com/downloads/finalbuilder/500/FB500_128.exe)
