Regular expression in JS
Regular expressions are patterns used to match character combinations in strings. In JavaScript, regular expressions are also objects. These patterns are used with the exec
and test
methods of RegExp
, and with the match
, replace
, search
, and split
methods of String
. This chapter describes JavaScript regular expressions.
翻译:
正则表达式是用于匹配字符串中的字符组合的模式。在JavaScript中,正则表达式也是对象。这些模式与使用exec
和 test
方法RegExp
,并与 match
,replace
, search
,和 split
方法 String
。本章介绍JavaScript正则表达式。