# Regex... Pls help me

**URL:** https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275
**Category:** Discussion
**Created:** [August 3, 2009, 4:15am UTC](https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275 "2009-08-03T04:15:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![entwicklung](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@entwicklung](https://www.finalbuilder.com/forums/u/entwicklung)
#### Post date: [August 3, 2009, 4:15am UTC](https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275/1 "2009-08-03T04:15:22Z")

</div>

Hi

I've got a problem with a regex script, but i don't find the result.

(.\*FILEVERSION ).\*(\r\n.\*PRODUCTVERSION ).\*(.\*FileVersion",").\*(\\0".\*ProductVersion",").\*(\\0".\*Comments","Build: ).\*(\\0".\*)

In the text, where the regex search, there are returns, spaces.

&nbsp;

I hope you can help me.

&nbsp;

regards

Sandro

---

<div class="post-metadata">

### Author: ![dick](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@dick](https://www.finalbuilder.com/forums/u/dick)
#### Post date: [August 4, 2009, 2:17am UTC](https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275/2 "2009-08-04T02:17:03Z")

</div>

Hi Sandro,

I'm assuming you want the values in the groups, not the names. So if you set singleline mode in your expression, the following pattern would extract the data you want.

You just need to add the "build:" part to the pattern (I'm assuming it is a custom string entry???)

`FILEVERSION\s*(\d+,\d+,\d+,\d+)\r\nPRODUCTVERSION\s*(\d+,\d+,\d+,\d+)\r\n.*VALUE\s"FileVersion",\s*"(\d+.\d+.\d+.\d+\\?0?)"\r\n.*VALUE\s"ProductVersion".\s*"(\d+.\d+.\d+.\d+\\?0?)"\r\n.*VALUE\s"Comments".\s*"(.*?\\?0?)"\r\n`

If you have already built the .exe, another alternative is to use the "Extract Version Info" action in "Files & Directories" to get the information from the .exe. It lets you select which elements of the version info you would like to extract and you can save them to FB variables.

Let me know if this helps

---

<div class="post-metadata">

### Author: ![entwicklung](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@entwicklung](https://www.finalbuilder.com/forums/u/entwicklung)
#### Post date: [August 4, 2009, 7:59am UTC](https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275/3 "2009-08-04T07:59:53Z")

</div>

Hi   
  
I don't read an \*.exe file... I read a \*.rc file, with "read text file"...   
When I read the \*.rc file out, than I would filling the list with Variables like this:   
  
  
// -------------------------------------------------   
// DO NOT EDIT (Machine generated file)   
// -------------------------------------------------   
  
// -------------------------------------------------   
// Language   
// -------------------------------------------------   
  
LANGUAGE LANG\_GERMAN, SUBLANG\_GERMAN\_SWISS   
  
// -------------------------------------------------   
// Main Icon   
// -------------------------------------------------   
  
MAINICON ICON IMPURE DISCARDABLE "D:\Source\System 6 SQL\presento\source\Main\presento.ico"   
  
// -------------------------------------------------   
// Version resource: D:\source\system 6 sql\Presento\source\Main\sys6sql.dpr   
// -------------------------------------------------   
  
VS\_VERSION\_INFO VERSIONINFO   
FILEVERSION %FileVersionE%   
PRODUCTVERSION %ProductVersionE%   
FILEFLAGSMASK VS\_FFI\_FILEFLAGSMASK   
FILEFLAGS VS\_FF\_PRERELEASE   
FILEOS VOS\_\_WINDOWS32   
FILETYPE VFT\_APP   
FILESUBTYPE VFT2\_UNKNOWN   
BEGIN   
BLOCK "StringFileInfo"   
BEGIN   
BLOCK "080704e4"   
BEGIN   
VALUE "CompanyName","%CompanyName%\0"   
VALUE "FileDescription","%ProductName%\0"   
VALUE "FileVersion","%FileVersion%\0"   
VALUE "InternalName","%InternalName%\0"   
VALUE "LegalCopyright","Copyright © 1996-2009\0"   
VALUE "LegalTrademarks","\0"   
VALUE "OriginalFileName","%OrginalName%\0"   
VALUE "ProductName","%ProductName%\0"   
VALUE "ProductVersion","%ProductVersion%\0"   
VALUE "Comments","Build: %date%\0"   
END   
END   
BLOCK "VarFileInfo"   
BEGIN   
Value "TRANSLATION", 0x0807, 1252   
END   
END   
  
But the regex Syntax does only until the second pair of clamps work... than he say he don't find a result...   
  
regards   
  
Sandro

---

<div class="post-metadata">

### Author: ![dick](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@dick](https://www.finalbuilder.com/forums/u/dick)
#### Post date: [August 5, 2009, 2:57am UTC](https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275/4 "2009-08-05T02:57:41Z")

</div>

OK, but this isn’t an RC file, it is a template for an RC file. The pattern I posted was assuming real values, not placeholders (which is why the version number was \d+,\d+,\d+,\d+, as that is 4 numbers separated by commas).   
  
 It sounds like you are trying to replace the placeholders in the file with variables, in which case if you use the “Replace Variables” action, it will open the file specified and if you tick/check “Write back to source” it will substitute the variables for you.

---

<div class="post-metadata">

### Author: ![entwicklung](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/e/ecae2f/32.png) [@entwicklung](https://www.finalbuilder.com/forums/u/entwicklung)
#### Post date: [August 5, 2009, 7:33am UTC](https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275/5 "2009-08-05T07:33:25Z")

</div>

Okey, it's a template... I would replace the placeholder thats right. In FinalBuilder I don't have this File. I have this file without Variables or placeholders, but there are other numbers and dates... So I read this file (in the variable "list") and than I should change there where the placeholders are the numbers... But my Regex does always fail, because he don't find this in the variable "list"... And nobody from work, do understand regex... So I hope you can help me.  
Do you understand what I mean? (Sry for my bad English ^^)

Regards

Sandro

&nbsp;

---

<div class="post-metadata">

### Author: ![dick](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@dick](https://www.finalbuilder.com/forums/u/dick)
#### Post date: [August 6, 2009, 9:18am UTC](https://www.finalbuilder.com/forums/t/regex-pls-help-me/1275/6 "2009-08-06T09:18:38Z")

</div>

Hi Sandro,   
  
 can you please supply the file that you DO have access to in FinalBuilder? If I can see the file, I can help you with the RegEx.   
  
 No need to apolgise for your English, it’s much better than my other languages (none)
