On 19 May 2012, at 10:04, coder wrote:
> var re = new RegExp('[<>\?\\[\\]]', 'g');
> What I'm asking now is, is there an equivalent function using words instead
> of characters?
In a regular expression "bar" will match "bar" while "[bar]" will match "b" or
"a" or "r". Just don't use the square brackets.
(You should also use regular expression literals ( /bar/ instead of new
RegExp("bar") ) as they avoid having to escape things for regex and then escape
them again for the string.)
--
David Dorward
http://dorward.me.uk
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [email protected]
*******************************************************************