(Sorry for the aborted earlier message. I had just one action selected when I hit the Share button. Again! Maybe if I ask @peternlewis nicely, he would pop up a confirmation dialog when someone tries to share a single action to ask if that's what they really want to do. Anyway, this is exactly the approach @tiffle suggested.)
Yes, I can see I do not need regex for this.
But I was forgot to mention this was actually not for Keyboard Maestro specific.
This forum has a lot of smart people in regards to regex.
Adobe InDesign (layout-software) has a feature called Grep Styles.
You define a regex and then you can automatically put a style of text on it.
In this case I was trying to make so that all misspelled versions for the brand name would be highlighted in red.
And it would be easier with just one regex.
I don't have Indesign to hand here, but I suppose the first thing to check might be whether the regex engine considers O and Ă etc to be the same thing.
Are you sure you cannot just brute strength it? There are only? 32 permutations and 31 are wrong. So just look for those 31 using RegEx. And you might be able to get rid of a few that are really unlikely. "fOTEX"??
BBEdit handles this without difficulty. The original post of the original poster did not mention Danish. The above includes the "correct" spelling whatever that is so in use that would be removed.
@rlivingston: Of course I can use the permutation solution. Still if the brand was "føTEXBILKANETTO" it would be a lot more
Do you have a smart way to generate the permutations?
where it looks like InDesign offers some help when constructing regex for use in styles.
I know this doesn't answer your question but using this facility may help you enter @ComplexPoint's regex successfully. Apologies of you've already tried this.
I can write a little program to get the permutations (which I did). But I did not realize that you needed a general solution. With the permutations going up as the power of 2 it does not take a very long name to make the brute force solution impractical.
In the end a search and replace is going to be done.
It is for a customer to help them visualize all the places and ways it is misspelled.
So more nice to have.
And then I took it as an opportunity to see if it was possible to do with one regex.
I just tested the second example (using the regex "fotext?") I gave you in the latest InDesign's search and replace and it worked fine. I did have to use the @ menu to enable case insensitivity so the regex became "fotext?(?-i)" but I'd let InDesign construct that for you.
By making it case insensitive, one regex handles a lot of permutations (just drop my list into an InDesign document and you'll see they are all caught).
Oh, and to handle multiple o's: "f[oø]text?(?-i)" would do it.
Here, in fact, is an InDesign Keyboard Maestro macro that automates the Grep search and replace for you: