Regular Expression Object
Language Reference |
See Also Methods Properties
Contains a regular expression pattern.
var regularexpression = /pattern/[switch]
var regularexpression = new RegExp("pattern",["switch"])
The regular expression object syntax has these parts:
Part Description pattern Required. The regular expression pattern to use. If you use Syntax 1, delimit the pattern by "/" characters. If you use Syntax 2, enclose the pattern in quotes. switch Optional. Enclose switch in quotes if you use Syntax 2. Available switches are: i (ignore case) g (global search for all occurrences of pattern) gi (global search, ignore case)
Regular Expression objects store patterns used when searching strings for character combinations. After the Regular Expression object is created, it is either passed to a string method, or a string is passed to one of the regular expression methods. Information about the most recent search performed is stored in the RegExp object.
Use Syntax 1 when you know the search string ahead of time. Use Syntax 2 when the search string is changing frequently, or is unknown, such as strings taken from user input.
The pattern argument is compiled into an internal format before use. For Syntax 1, pattern is compiled as the script is loaded. For Syntax 2, pattern is compiled just before use, or when the compile method is called.
© 1997 by Microsoft Corporation. All rights reserved.
|file: /Techref/inet/iis/jscript/htm/js600.htm, 3KB, , updated: 2008/2/2 05:15, local time: 2018/5/25 22:52,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/inet/iis/jscript/htm/js600.htm"> Regular Expression Object</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180525 RussellMc, Van Horn, David, Sean Breheny, Isaac M. Bavaresco, Bob Blick, David C Brown, Neil, alan.b.pearce, Brent Brown, John Gardner,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!