I am looking for simple way to use regex and catch variant of word with simplest format. For example, the 5 variants of the word below.
hike hhike hiike hikke hikkee
Using something similar to the format below...
[([a-zA-Z]){4,}]
Thanks
I am looking for simple way to use regex and catch variant of word with simplest format. For example, the 5 variants of the word below.
hike hhike hiike hikke hikkee
Using something similar to the format below...
[([a-zA-Z]){4,}]
Thanks
Are you looking for something like /h+i+k+e+/?
Meaning:
h character repeated 1 to infinity timesi character repeated 1 to infinity timesk character repeated 1 to infinity timese character repeated 1 to infinity timesIf each character can maximum be there twice, you can use /h{1,2}i{1,2}k{1,2}e{1,2}/ meaning "present 1 or 2 times".
This is more of a soundex kind of problem I think:
You probably cannot solve this generically (i.e. for any word) under standard regex syntax.
For a given word, as others have pointed out, it is trivial.