The first paragraph in the KM wiki page for regular expressions says:
Keyboard Maestro uses ICU Regular Expressions (aka RegEx or RegExp) which is very similar to PCRE (Perl Compatible Regular Expressions), and you can read their documentation by choosing ICU Regular Expression Reference from the Help menu in Keyboard Maestro.
Tired of reinventing the wheel at a snail's pace, I bought TextSoap which has a large library of text transform regex called "cleaners" which I run via KBM with the AppleScript action and the following script
tell application "textsoapAgent"
cleanClipboard with "Name of Cleaner here"
end tell
And there are some nice surprises. I work a lot in Scrivener and frequently change my line spacing from 1 to 1.5 and back which is easy with TextSoap but complicated (if I understand correctly) with regex.