D
Dr John Stockton
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.
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.