ISTM that RegExps deserve a FAQ entry, with links to more detailed
sources.
An important question, probably not treated by many otherwise worthwhile
sources, must be on feature detection of the newer RegExp facilities -
for example, greedy/non-greedy.
The answer may be that it is not possible to do so in a safe manner;
that one can do no better than something like
document.write( "Testing non-greedy :- ")
X = /<trialRegExp>/.test(string)
document.write( "survived." )
That is, nevertheless, a useful answer; if it is right, it prevents the
naive seeking anything better, and if it is wrong someone will soon say
so.
Where a page requires an advanced RegExp facility, it is best to have a
controlled failure at a well-chosen point.
Putting something in the posted FAQ will provide an opportunity for
adding a reference to the Notes; and, without such a reference, their
value is much reduced.
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Comment