-2

In order to memorise code syntax I'm using a memory technique for memorising collections of letters by using a combination of letters and vowel's and searching for words using a regex dictionary found here: https://www.visca.com/regexdict/

So for example if I wanted to create a word from the abbreviation "HTML" I would use:

H followed by zero or more Vowels, followed by T, followed by zero or more Vowels, followed M, followed by zero or more Vowels and then L followed by zero or more Vowels

I would then use the regex dictionary above to find any words that contain these specific letter combinations.

So any words that contain the following combination of letters: H(a|e|i|o|u)T(a|e|i|o|u)M(a|e|i|o|u)L(a|e|i|o|u)

The vowels can be any combination of a,e,i,o,u , they can be used more than once between the letters or not at all, or even at the end. So long as the letter combination forms a word from the regex dictionary.

So for HTML one of the words found would be H(a)T(e)M(ai)L

What regex combination would enable me to do this?

Thank you

Simon
  • 41
  • 3
  • Do you mean `(?:[A-Z][AEIOU]*)+`? See [here](https://regex101.com/r/smFpVr/1). – Paolo Aug 03 '18 at 22:21
  • I don't think so since the vowels would have to go in between the specific letters and zero or more vowels at the end of the letters. The example I gave was H(a)T(e)M(ai)L from the letter combination HTML but that's only one word, there's probably others.... I could use the following Regex dictionary to look for words. https://www.visca.com/regexdict/ I tried copy and pasting your combination and it didn't work – Simon Aug 03 '18 at 22:23

1 Answers1

0

Try this:

^H[aeiou]*T[aeiou]*M[aeiou]*L[aeiou]*$

See live demo.

For case insensitivity, add (?i) to the start of the regex.

—-

BTW “zero, one or more” is the same as just “zero or more”.

Bohemian
  • 412,405
  • 93
  • 575
  • 722
  • I don't think that's correct. I tried adding that combination to https://www.visca.com/regexdict/ and it didn't find any words... I tried adding different letters, still nothing found from the regex word dictionary – Simon Aug 03 '18 at 22:28
  • I've tried to clarify my question by stating zero or more vowels between the letters. So any words that contain the following combination of letters H(a|e|i|o|u)T(a|e|i|o|u)M(a|e|i|o|u)L(a|e|i|o|u) The vowels can be any combination of a,e,i,o,u , none or used more than once together – Simon Aug 03 '18 at 22:33
  • Your solution is the best and now I've tested different string combinations using your live demo I can see it works. However it doesn't work for the regex dictionary at https://www.visca.com/regexdict/ Do you know of any regex dictionary's that can generate English words from Regex strings? – Simon Aug 03 '18 at 23:29
  • If you remove the start of string anchor (^) on this regex it will return a result from visca: photomultiplier. Your issue is that the dictionary doesn't have enough words in it to match your particular example. Try some other acronyms and you might have more success. – Nick Aug 04 '18 at 09:17
  • I did Nick and it found something.. I tried something as simple as H[aeiou]*T[aeiou]*$ and still nothing – Simon Aug 05 '18 at 17:02