Swap words using regex

Hi Team,

i want to swap the words using regex. using group but don’t know how to use that group for swapping.

(1993) JurassicParkRating 9.6.avi

now i want to swap as 9.6 JurassicParkRating (1993).avi

I am able to understand the regex using this pattern

^(\d.\d)([^(])(([\d]{4}))(.)
Now it is said in some website that we can replace using the captured groups
Replace Pattern - \3\2\1\4 - 3,2,1,4 is the captured groups

when we use regex.replace there is only an option to replace string and no replace pattern. Could anyone let me know how to swap using replacement pattern in uipath?

Thanks,
Ula

Hi,

We can achieve it using Replace activity with the following settings.

Pattern: "^(\(\d{4}\))(.+)(\d+\.\d+)(.+)$"
Replacement: "$3$2$1$4"

Regards,

1 Like

hi @Yoichi

Thanks a lot. It is working now.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.