Describes how to use the JS Regular Expression replace and the jsreplace
Before talking about the advanced application of replace, let's sort out several important knowledge points in JS regular expressions to help you review your basic knowledge,
Match MethodUse the regular expression pattern to perform a lookup on a string and return the result that contains the lookup as an array.Stringobj.match (RGEXP)ParametersStringobjRequired option. A string object or string literal on which to
JS regular function match, exec, test, search, replace, split use the introduction set1.match MethodUse the regular expression pattern to perform a lookup on a string and return the result that contains the lookup as an array.Stringobj.match
article transferred from http://www.jb51.net/article/28007.htmThe purpose is that the content can match the results of all matches, to a few common query keywords, easy to check the person see the article, JS regular match all JS Reg Next, the key
The original Http://www.jb51.net/article/28007.htm JS regular function match, exec, test, search, replace, split use the introduction set, learning regular expression of friends can refer to.
Match Method Use the regular expression pattern to
Js replace and replaceall instance usage
StringObj. replace (rgExp, replaceText)
Parameters
StringObj
Required. String object or String text to be replaced. The string is not modified by the replace method.
RgExp
Required. It is a regular expression
The syntax of the replace method is stringobj. replace (rgexp, replacetext) Where stringobj is a string, reexp can be a regular expression object (Regexp) or a string (string), and replacetext is a replacement string found .. For better
JS function set overview, js function set1.doc ument. write (""); Output statement2. Comments in JS are //3. the traditional HTML document sequence is: document-> html-> (head, body) 4. the DOM sequence in a browser window is: window-> (navigator,
This article describes the JS String function String. replace (). For more information, see. Replace (one or more) substrings matching a given regular expression
String. replace (regexp, replacement)
Parameters:
Regexp: RegExp object or string
Match methodUse the regular expression pattern to perform a lookup on a string and return the result that contains the lookup as an array.Stringobj.match (RGEXP)ParametersStringobjRequired option. A string object or string literal on which to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.