Socrates440 has asked for the wisdom of the Perl Monks concerning the following question:
My question for the above script is what is the i outside of each of the // symbles. The second script is:while (<STDIN>) { if (/a/i && /e/i && /i/i && /o/i && /u/i) { print; } }
For this script I have a few more questions. It is supposed to parse a statement in order to determine if it shows each of the vowels in order. Why couldn't one just do this /a*i*o*u*/. Also what does e^aiou actually look for? e with any vowel character after it? Last, what is the purpose of the $ sign. I found this code very confusing. Thanks for your help!hile (<>) { print if (/^[^aeiou]*a[^eiou]*e[^aiou]*i[^aeou]*o[^aeiu]*u[^aeio]*$ ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Expression
by toolic (Bishop) on Jun 21, 2012 at 02:20 UTC | |
|
Re: Regular Expression
by roboticus (Chancellor) on Jun 21, 2012 at 01:50 UTC | |
|
Re: Regular Expression
by frozenwithjoy (Priest) on Jun 21, 2012 at 02:31 UTC | |
by Athanasius (Archbishop) on Jun 21, 2012 at 04:36 UTC | |
by Socrates440 (Acolyte) on Jun 21, 2012 at 05:00 UTC | |
by choroba (Cardinal) on Jun 21, 2012 at 06:13 UTC | |
by Athanasius (Archbishop) on Jun 21, 2012 at 06:18 UTC | |
by MidLifeXis (Monsignor) on Jun 21, 2012 at 12:42 UTC |