Regular Expressions: How to Substitute

Hi Support Team,

I use the Perforce actions and want to determine a workspace root folder. For that I use Perforce Generic command with the 'client' command. Arguments are "-o %P4WorkSpace%". This brings the following output, which I log to a variable (shortened):

Owner:  Michael
Root:   F:\Daten\Perforce
SubmitOptions:  revertunchanged

In order to get a clue of how to grab the root folder name I use "TRegExpr 0.947 test program". The following regular expression works well:

(?mg-si)Root:\s*(.*)$

When I use $1 als template string on the 'substitute' tab card, the substitution result is F:\Daten\Perforce.

Unfortunately it seems that there is no FB Action available providing any similar.

I only see the Text Replace Action dealing with regular expressions - but here I only can use substitution in replacements. Using $1 as replacement string will lead to the following text:

Owner:  Michael
F:\Daten\Perforce
SubmitOptions:  revertunchanged

Do you know any other action providing substitution without replacement or would you mind to give me a hint of how to extract the desired portion of text without a list iterator or further regular expression replacements (removing the part before and after...)?

Best regards
Michael

Hi Support Team,

forgot my post - I worked out a regular expression removing the leading and trailing part and using this I can use the existing action.

For other users having similar problems here is the regular expression:

(?ims)\A.*^Root:\s*(?-s)(\S.*$)(?s).*\Z

In $1 is the folder name.

Best regards
Michael