Hello,

Is it possible to put variable in <pattern></pattern> tag when I'm using regExMatch. As an example if I want to check if my installdir variable ends with the pattern /${project.vendor}-${project.version}/${product_shortname} If it is possible what is the format to user variable inside pattern tag ?

<setInstallerVariable>
 <name>installdir</name>
 <value>${installdir}/${project.vendor}-${project.version}/${product_shortname}</value>
 <ruleEvaluationLogic>and</ruleEvaluationLogic>
 <ruleList>
   <regExMatch>
     <logic>does_not_match</logic>
     <pattern>\/${project.vendor}-${project.version}\/${product_shortname}$</pattern>
     <text>${installdir}</text>
   </regExMatch>    
 </ruleList>
</setinstallervariable>

Thank You, Ronen

asked 15 Jan '13, 08:17

Ronen's gravatar image

Ronen
16565656
accept rate: 0%


If you are trying to use the contents of those variables as the pattern, you can directly use them:

<setInstallerVariable>
 <name>installdir</name>
 <value>${installdir}/${project.vendor}-${project.version}/${product_shortname}</value>
 <ruleEvaluationLogic>and</ruleEvaluationLogic>
 <ruleList>
   <regExMatch>
     <logic>does_not_match</logic>
     <pattern>${project.vendor}-${project.version}/${product_shortname}$</pattern>
     <text>${installdir}</text>
   </regExMatch>    
 </ruleList>
</setinstallervariable>

But if you only need to check if that string is present, you could simply use:

<compareText text="${installdir}" logic="does_not_contain" value="${project.vendor}-${project.version}/${product_shortname}"/>
link

answered 15 Jan '13, 08:26

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

in my case I need to check that these variable are located in the end of the string. I guess I need to user the first option suggested above with the $ sign at the end , correct ?

link

answered 15 Jan '13, 08:56

Ronen's gravatar image

Ronen
16565656
accept rate: 0%

Yes, I have corrected the pattern.

(15 Jan '13, 09:19) juanjo ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5

Asked: 15 Jan '13, 08:17

Seen: 1,048 times

Last updated: 15 Jan '13, 09:19