In my Java app, I want to use a regex to be able to know if a string exists or not in a text.
The case I want to cover is this one: let's assume that my original text is the following french text (with an accent):
démo test
I want to know if the word demo
(without accent) exists in the text, using a regex. The thing is: I can't change the original text (I can't use Normalizer.normalize()
for example), since I'm using a library that takes a regex as an argument.
Here is what I tried:
- If I use
"(?i)démo"
, there is a match (sincedémo
exists) - If I use
"(?i)demo"
, there is no match, but I also want a match here. I want the regex to be accent insensitive.
So far, I haven't managed to find a regex that can cover that specific case.
Is there any regex that can cover that case?
Thanks for your help.