Subj : Re: RegExp bug? (test case included) To : netscape.public.mozilla.jseng From : Igor Bukanov Date : Sun Feb 23 2003 03:25 pm Michael Caines wrote: > http://mikecaines.topcities.com/misc/regexpbug.html Please include next time test cases inline if they are simple or at least point to a page with just the test case and nothing else. > > IE6 returns the expected three matches: [mmm],[dd],[yyyy] > Moz1.3b & Opera return none (null). > EcmaScript v3 , see http://mozilla.org/js/language/E262-3.pdf, 15.10.1, defines that ] in a range specification is not treated specially even if it is the first character. Which means you always need to escape ] in your range specifications. The following works: var string = '[mmm]/[dd]/[yyyy]'; var matchResults = string.match( /[[]((m|d|y){1,4})[\]]/gi ); document.write(matchResults) Regards, Igor .