I can't believe that it's 2023 and Power Automate doesn't have a regular expression action out of the box yet.
This feature is desperately needed and resorting to azure functions as a solution is too cumbersome. There are some premium connectors that can do it, but they're slow in many cases and aren't free either.
Come on Microsoft! we need this!