# Find/replace text help

**URL:** https://www.finalbuilder.com/forums/t/find-replace-text-help/686
**Category:** Discussion
**Created:** [December 7, 2007, 12:46pm UTC](https://www.finalbuilder.com/forums/t/find-replace-text-help/686 "2007-12-07T12:46:24Z")
**Posts on this page:** 5
**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: [December 7, 2007, 12:46pm UTC](https://www.finalbuilder.com/forums/t/find-replace-text-help/686/1 "2007-12-07T12:46:24Z")

</div>

hello

i have a question...i hope someone can help me....

i use the action "text/find replace" to find a special 32 long digit in a textfile....

unter the option "search String" i use this code

\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w\w

this works fine....after finding this 32 digits i want put it in a variable or in a other textfile....but to bad i just have options to replace the text i have found....

is there any other option to find a special text and put it in a varibale or textfile ?

Thx Frank

---

<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: [December 7, 2007, 3:47am UTC](https://www.finalbuilder.com/forums/t/find-replace-text-help/686/2 "2007-12-07T03:47:05Z")

</div>

Hi Frank,   
  
 Thanks for your post.   
  
 As an aside, you should be able to use the syntax \w{32} to find a 32-digit long number. No more need for counting individual \ws. :-).   
  
 To answer your question, there is an OnFindText script event on the action with a parameter called FoundText. You can do something like   
  
 MyBigNumberVariable = FoundText   
  
  
 … to save it to a FB variable called “MyBigNumberVariable”.   
  
 Hth.   
  
 Regards,   
  
 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: [December 7, 2007, 3:47am UTC](https://www.finalbuilder.com/forums/t/find-replace-text-help/686/3 "2007-12-07T03:47:45Z")

</div>

It’s a limitation in the current version of text find/replace. My normal workaround:   
 1. Read the text file into a variable   
 2. Find/replace with a string like: ([0-9]{32}) \<- note the parentheses   
 3. Choose “replace” and “save to same variable” (or whatever it’s called)   
 4. Set $1 as the replacement string.   
  
 Obviously you have to select regex, and enable the $1 type replacement strings.   
  
 Then basically you’ll be replacing the entire contents of the file (in memory) with just the contents of that 1 string.   
  
 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: [December 7, 2007, 3:49am UTC](https://www.finalbuilder.com/forums/t/find-replace-text-help/686/4 "2007-12-07T03:49:55Z")

</div>

Crossed posts!   
  
Yes, Steve's workaround works as well. I think the forum software mangled the regex, though...   
  
(\w{32}) will work for this, as well. Replace \w with \d if you only need numbers, not numbers and characters.

There's a great regular expression reference here: [http://www.regular-expressions.info/reference.html](http://www.regular-expressions.info/reference.html)  
  
Regards,   
  
Angus

---

<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: [December 7, 2007, 5:58am UTC](https://www.finalbuilder.com/forums/t/find-replace-text-help/686/5 "2007-12-07T05:58:36Z")

</div>

thank you very much guys...that looks both very good...it works like a charm :D :D BOTH !!!!

&nbsp;

&nbsp;
