Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=180500018

Script, Scripting Language, VBScript elements, Server-Side VBScript Object Element RegExp Property

VBScript Properties of RegExp Object

Some typical predefined Elements are.

  •  RegExp Object:
    • Global Property
    • IgnoreCase Property
    • Pattern Property
    • Execute Method
      • Count Property

Global Property

last updated 12/11/2017

is to set, if optional Boolean value True or False is given, or to return a Boolean value of Global property of associated RegEXp Object indicating a pattern should match all occurrences with True or just match the first one with False in an entire search string.

Syntax

reobjvar.Global [= True | False ]

Argument

reobjvarRequired. The variable name of the associated Object instantance.GlobalRequired Property Keyword. To specify the Global Property of an Object.TrueOptional, but cannot be specified together with False. To specify the search applies to the entire string.FalseOptional, but cannot be specified together with True. To specify the search does not apply to the entire string. Default if omitted..Required. The dot notation used to access the Property of an object.[…]Optional. The brackets to enclose the optional parameters.=Required. required as assigning equal to operator for setting the value of Global to True or False.

Remarks

  • If the Global Property setting is omitted, the default value is False.

Requirement

5

Applied to

RegExp Object

IgnoreCase Property

last updated 12/11/2017

is to set, if optional Boolean value True or False is given, or to return a Boolean value of IgnoreCase property of associated RegEXp Object indicating a pattern search is case-sensitive with False or not case-sensitive with True.

Syntax

reobjvar.IgnoreCase [= True | False ]

Argument

reobjvarRequired. The variable name of the associated Object instantance.IgnoreCaseRequired Property Keyword. To specify the IgnoreCase Property of an Object.TrueOptional, but cannot be specified together with False. To specify a pattern search is case-sensitive.FalseOptional, but cannot be specified together with True. To specify a pattern search is not case-sensitive. Default if omitted..Required. The dot notation used to access the Property of an object.[…]Optional. The brackets to enclose the optional parameters.=Required. required as assigning equal to operator for setting the value of Global to True or False.

Remarks

  • If the IgnoreCase Property setting is omitted, the default value is False.

Requirement

5

Applied to

RegExp Object

Pattern Property

last updated 12/11/2017

is to set, if optional searchstring is given, or to return the pattern being searched for of associated RegExp Object.

Syntax

reobjvar.Pattern [= searchstring]

Argument

reobjvarRequired. The variable name of the associated Object instantance.PatternRequired Property Keyword. To specify the Pattern Property of an Object.searchstringOptional. Regular string expression being searched for. May include any predefined regular expression characters for setting..Required. The dot notation used to access the Property of an object.[…]Optional. The brackets to enclose the optional parameters.=Required. required as assigning equal to operator for setting the value of Pattern to searchstring.

Settings

Special characters and sequences for writing patterns of regular expressions

CharacterDescription\Marks the next character as either a special character or a literal. For example, "n" matches the character "n". "\n" matches a newline character. The sequence "\\" matches "\" and "\(" matches "(".^Matches the beginning of input.$Matches the end of input.*Matches the preceding character zero or more times. For example, "zo*" matches either "z" or "zoo".+Matches the preceding character one or more times. For example, "zo+" matches "zoo" but not "z".?Matches the preceding character zero or one time. For example, "a?ve?" matches the "ve" in "never"..Matches any single character except a newline character.(pattern)Matches pattern and remembers the match. The matched substring can be retrieved from the resulting Matches collection, using Item [0]…[n]. To match parentheses characters ( ), use "\(" or "\)".x|yMatches either x or y. For example, "z|wood" matches "z" or "wood". "(z|w)oo" matches "zoo" or "wood".{n}n is a nonnegative integer. Matches exactly n times. For example, "o{2}" does not match the "o" in "Bob," but matches the first two o's in "foooood".{n,}n is a nonnegative integer. Matches at least n times. For example, "o{2,}" does not match the "o" in "Bob" and matches all the o's in "foooood." "o{1,}" is equivalent to "o+". "o{0,}" is equivalent to "o*".{n,m}m and n are nonnegative integers. Matches at least n and at most m times. For example, "o{1,3}" matches the first three o's in "fooooood." "o{0,1}" is equivalent to "o?".[xyz]A character set. Matches any one of the enclosed characters. For example, "[abc]" matches the "a" in "plain".[^xyz]A negative character set. Matches any character not enclosed. For example, "[^abc]" matches the "p" in "plain".[a-z]A range of characters. Matches any character in the specified range. For example, "[a-z]" matches any lowercase alphabetic character in the range "a" through "z".[^m-z]A negative range characters. Matches any character not in the specified range. For example, "[^m-z]" matches any character not in the range "m" through "z".\bMatches a word boundary, that is, the position between a word and a space. For example, "er\b" matches the "er" in "never" but not the "er" in "verb".\BMatches a non-word boundary. "ea*r\B" matches the "ear" in "never early".\dMatches a digit character. Equivalent to [0-9].\DMatches a non-digit character. Equivalent to [^0-9].\fMatches a form-feed character.\nMatches a newline character.\rMatches a carriage return character.\sMatches any white space including space, tab, form-feed, etc. Equivalent to "[ \f\n\r\t\v]".\SMatches any nonwhite space character. Equivalent to "[^ \f\n\r\t\v]".\tMatches a tab character.\vMatches a vertical tab character.\wMatches any word character including underscore. Equivalent to "[A-Za-z0-9_]".\WMatches any non-word character. Equivalent to "[^A-Za-z0-9_]".\numMatches num, where num is a positive integer. A reference back to remembered matches. For example, "(.)\1" matches two consecutive identical characters.\nMatches n, where n is an octal escape value. Octal escape values must be 1, 2, or 3 digits long. For example, "\11" and "\011" both match a tab character. "\0011" is the equivalent of "\001" & "1". Octal escape values must not exceed 256. If they do, only the first two digits comprise the expression. Allows ASCII codes to be used in regular expressions.\xnMatches n, where n is a hexadecimal escape value. Hexadecimal escape values must be exactly two digits long. For example, "\x41" matches "A". "\x041" is equivalent to "\x04" & "1". Allows ASCII codes to be used in regular expressions.

Remarks

  • The setting of special characters and sequences can be used in writing patterns for regular expressions.

Requirement

5

Applied to

RegExp Object

RegExp Execute Method

The returns of the Execute Method of RegExp Object is a Collection of Match Objects and is contained in a Matches Collection.

Count Property

last updated 12/9/2017

is to return the read-only number of elements in the associated Collection or Object.

Syntax

objvar.Count

Argument

objvarRequired. The variable name of the associated Object instantance.CountRequired Property Keyword. To specify the Count Property of an Object..Required. The dot notation used to access the Property of an object.

Remarks

  • Count Property is a genetic Property for all being supported Object.
  • Count Property is a read-only property.

Applied to

Dictionary Object, Drives Collection, Files Collection, Folders Collection, Matches Collection

Item Property

last updated 12/9/2017

is to return the read-only item of an element in the associated collection or Object according to the specified key

Syntax

objvar.Item(key)

Argument

objvarRequired. The variable name of the associated Object instantance.ItemRequired Property Keyword. To specify the Item Property of an Object.keyRequired. To specify the key used to return the item of the specified key..Required. the dot notation used to access the Property of an object.(…)Required. the brackets to enclose the parameters.

Remarks

  • Item Property is a genetic Property for all being supported Object.
  • Item Property is a read-only property.
  • An error will return if the specified key is not found.

Applied to

Matches Collection,

Sideway BICK Blog

18/05


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013