1

I am studying regex right now. This is my question: "I think that I shall never see a poem lovely as a tree. - Joyce Kilmer" Use the regex to return "I, thi, tha, I, sha, ne, se, a, po, lo, a, a, tre, Jo, Ki"

Feng Zhang
  • 11
  • 1

1 Answers1

0

This is what I came up with

\b[^\sAEIOUaeiou]*[aeiouAEIOU]

http://regexr.com/3gvo3

to break it down

\b is a word boundary so it searches for whole words

[^\sAEIOUaeiou]* will match any character that isnt a space or a vowel

[aeiouAEIOU] will match the first occurence of a vowel in the word

Samantha
  • 507
  • 5
  • 13