Regular Expressions in VBScript are different from Perl expressions.

Source: Internet
Author: User

Source: http://www.regular-expressions.info/vbscript.html

 

VBScript's regular expression support
VBScript has built-in support for regular expressions. if you use Vbscript to validate user input on a web page at the client side, Using VBScript's regular expression support will greatly reduce the amount of code you need to write.

Microsoft made some significant enhancements to VBScript's regular expression support in version 5.5 of Internet Explorer. version 5.5 implements quite a few essential RegEx features that were missing in previous versions of VBScript. internet Explorer 6.0 does not expand the regular expression functionality. whenever this website mentions VBScript, the statements refer to VBScript's version 5.5 Regular Expression support.

In fact, the regular expression flavor used in the version 5.5 VBScript object is the same one used by JavaScript and JScript. the RegEx flavor is part of the ECMA-262 standard for JavaScript. therefore, everything said about JavaScript's regular expression flavor on this website also applies to VBScript. the only exception is the character escape support for/xFF and/Uffff In the replacement text. javascript supports these in string literals, but VBScript does not.

JavaScript and VBScript implement Perl-style regular expressions. However, they lack quite a number of advanced features available in Perl and other modern regular expression flavors:

NO/A or/Z anchors to match the start or end of the string. use a caret or dollar instead.
lookbehind is not supported at all. lookahead is fully supported.
no atomic grouping or possessive quantifiers
NO Unicode support, matching T for matching single characters with/Uffff
no named capturing groups. use Numbered capturing groups instead.
NO mode modifiers to set matching options within the regular expression.
NO conditionals.
no regular expression comments. describe your regular expression with VBScript apostrophe comments instead, outside the regular expression string.
Version 1.0 of the Regexp object even lacks basic features like lazy quantifiers. this is the main reason this website does not discuss VBScript Regexp 1.0. all versions of Internet Explorer prior to 5.5 include version 1.0 of the Regexp object. there are no other versions than 1.0 and 5.5.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.