Removing Trailing Slash(es) From Input String

Answered

Comments

1 comment

  • Avatar
    alejandror

    Hi Mark,

    In order to remove the trailing slashes using <setInstallerVariableFromRegEx> you could use the regular expression "^(.*?)\/*$" :

    <setInstallerVariableFromRegEx> <name>text_without_trailing_slashes</name> <pattern>^(.*?)\/*$</pattern> <substitution>\1</substitution> <text>text with trailing slashes///</text> </setInstallerVariableFromRegEx>

    Please note the modifier '?' inside the capturing group, which will make the .* to be ungreedy.

    0
    Comment actions Permalink

Please sign in to leave a comment.