& ltbr & gtvar? Str = & ampquot answer? b? c? Me? Me? Answer? Men? Answer? Babu & quot & ltbr & gtvar? reg=/[^Abc]+/g。
& ltbr & gt//var? result = reg . exec(str); & ltbr & gtvar? result = str . match(reg); & ltbr & gtif(result = = null)& lt; br & gt。
{& ltbr & gtAlert ('Please re-enter'); & ltbr} else {& ltbr & gtalert (result. length); & ltbr & gt}。
Extended data:
JavaScript is a scripting language, and its source code does not need to be compiled before it is sent to the client, but the character code in text format is sent to the browser for interpretation and operation. The weakness of literal translation languages is poor security. In JavaScript, if one language can't run, then the following languages can't run. The solution is to use try{}catch(){}.
Javascript is classified as a literal translation language, because the mainstream engine loads the code and interprets it every time it runs. V8 interprets all codes before running, and other engines interpret them line by line (SpiderMonkey interprets instructions temporarily to improve performance, which is called real-time compilation).
However, because most of the core parts of V8 are written in Javascript (while SpiderMonkey is written in C++), there are advantages and disadvantages in different tests. Corresponding to it is a compilation language, such as C language. Before running a program written in a compiled language, it must be compiled, the code compiled into machine code, and then run.
Baidu encyclopedia -javascript