regexnintex-workflow

Grab first 4 characters of two words RegEx


I would like to grab the first 4 characters of two words using RegEx. I have some RegEx experinece however a search did not yeild any results.

So if I have Awesome Sauce I would like the end result to be AwesSauc


Solution

  • Use the Replace Text action with the following parameters:

    Pattern: \W*\b(\p{L}{1,4})\w*\W*
    Replacement text: $1

    See the regex demo.

    Pattern details: