VMware Cloud Community
madgo
Contributor
Contributor

Extracting string from multiline string using Regular Expression

Hi,

I am trying to extract the last line CRYPT:adk6oNRwypFwA into another variable from the following text which is an output of another action.

2021-08-12 12:45:17.040:INFO::main: Logging initialized @650ms
admin123
OBF:1igd1iup1kfv1vne1vno1kcj1irx1idt
MD5:0192023a7bbd73250516f069df18b500
CRYPT:adk6oNRwypFwA

I tried the expression ^(CRYPT).*$ but it's not working.

I also tried ^(CRYPT).*

No luck.

Please help me regarding this.

Thanks and Best Regards

Madhu

Labels (1)
0 Kudos
1 Reply
michieldhont_
Hot Shot
Hot Shot

Hi @madgo,

I replied in private support but I'll add my reply here as well. To get the value of CRYPT: could you try the following?

<setInstallerVariableFromRegEx>
  <name>extension</name>
  <pattern>^CRYPT:(.*)$</pattern>
  <substitution>\1</substitution>
  <text>${logFile}</text>
</setInstallerVariableFromRegEx>

 

Regards,

Michiel

0 Kudos