Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: javascript - wildcards
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: javascript - wildcards




On Jul 6, 2009, at 1:50 PM, Robert Poland wrote:

What I'm after is for this line to remove all letters;
elementValue = elementValue.replace(/a-z/ig, '')
I have tried [a-z], {a-z}, "a-z".

You want:
elementValue = elementValue.replace(/[a-z]/ig, '')

Can't find any mention of this in my books or on the web.

There are entire books written about regular expressions :) I have one, although it's just the little "pocket guide" from O'Reilly.
And any _javascript_ book worth its salt should have at least a chapter on RE's.
Here's some documentation from mozilla's _javascript_ reference:
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/RegExp

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Web-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >javascript - wildcards (From: Robert Poland <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.