RegExp : only [a-z]

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
sylvainhugues
Forum Newbie
Posts: 1
Joined: Sun Aug 17, 2008 9:06 pm

RegExp : only [a-z]

Post by sylvainhugues »

Salut,

working under flash, I apply this regexp : /[a-z]/
to this string : "aà8"

and it returns true because of the "a".
I want it to return false, because I want a string with ONLY caracters from a to z.
"à" and "8" are not from a to z.

How to force matching like this ?

merci, Sylvain.
User avatar
GeertDD
Forum Contributor
Posts: 274
Joined: Sun Oct 22, 2006 1:47 am
Location: Belgium

Re: RegExp : only [a-z]

Post by GeertDD »

Code: Select all

preg_match('/^[a-z]++$/D', $str);
Post Reply