Graeme McLaren wrote:
Morning all, would anyone be able to explain this regular expression:

/^[\w ,.!?\-'"\(\)\s]+$/


I'm going to read up on it but I'm in a hurry for this.

Everything inside [] defines a character class which is a list of characters, any one of which can match a single character in the string and which includes the \w and \s character classes. The regular expression says to match at the beginning of the string one or more of any characters in the character class to the end of the string. The purpose is to determine if the string contains ONLY the characters in the character class.


John -- use Perl; program fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to