RE explanation

J

julia_2683

Could someone give me an explanation for each part of this regular
expression ?

/\b((?:(?=[a-z])[^aeiou])*[aeiou](?:(?=[a-z])[^aeiou])*)\b/ig

Many thanks
 
G

Gunnar Hjalmarsson

Could someone give me an explanation for each part of this regular
expression ?

/\b((?:(?=[a-z])[^aeiou])*[aeiou](?:(?=[a-z])[^aeiou])*)\b/ig

Why? I'd suggest that you look it up at first hand:

perldoc perlre

and ask a question if there is anything specific you can't figure out
that way.
 
A

Arndt Jonasson

Could someone give me an explanation for each part of this regular
expression ?

/\b((?:(?=[a-z])[^aeiou])*[aeiou](?:(?=[a-z])[^aeiou])*)\b/ig

It seems to match words which contain exactly one vowel.

See perldoc perlre.
 
G

Greg Bacon

: Doesn't the letter 'y' also count as a vowel in English? (In Swedish
: it does.)

Yes! Well, maybe.. Hm, maybe not..

Oh, bother. :-/

Greg
 
A

axel

Gunnar Hjalmarsson said:
Arndt said:
(e-mail address removed) writes:
/\b((?:(?=[a-z])[^aeiou])*[aeiou](?:(?=[a-z])[^aeiou])*)\b/ig
It seems to match words which contain exactly one vowel.
Doesn't the letter 'y' also count as a vowel in English? (In Swedish it
does.)

It does. But also a consonant.

But then most English people are brought up with the myth of five
vowels.

Axel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,170
Messages
2,570,925
Members
47,468
Latest member
Fannie44U3

Latest Threads

Top