Link:http://output.to/sideway/default.asp?qno=180500020 Script, Scripting Language, VBScript elements, Server-Side VBScript RegExp Match Object
VBScript RegExp Match ObjectRegExp Match Object is a VBScript Object designed for manipulating the matched object returned by Execute Method of RegExp Object. Match Object is the basic unit of matched object per the Pattern Property of RegExp Object. And four Properties are provided for the manipulation of the matched object. The returns of Execute Property is a collection of submatched objects, that is the SubMatches Collection. Additional Count Property, and Item Property are provided for accessing the Properties of SubMatches Collection directly through dot notation.
Match Objectlast updated 12/11/2017is to provide access to a regular expression match of a regular expression search. SyntaxSet rematobjvar=reobjvar.Execute(string).Item(key) Remarks
Requirement5Match Propertieslast updated 12/11/2017Four Properties are predefined to manipulate the read-only properties of a Match Object obtained from the Matches Collection returned from the Execute Mothod of RegExp Object. SyntaxSet rematobjvar=reobjvar.Execute(string).Item(key) rematobjvar.FirstIndex rematobjvar.Length rematobjvar.Value rematobjvar.SubMatches Match Collectionslast updated 12/11/2017The output of the SubMatches Property of Match Object is a Collection of SubMatch Objects, namely SubMatches Collection. In other words, Collection of regular expression submatch strings returned by the read-only SubMatches Property of a Match Objcet obtained from the Matches Collection returned from the Execute Mothod of RegExp Object is called SubMatches Collection. SyntaxSet rematobjvar=reobjvar.Execute(string).Item(key) Set resubmatcolvar=rematobjvar.SubMatches Match.SubMarches Propertylast updated 12/12/2017Two Properties are predefined for the returns of SubMarches Property of Match Object, namely, Count Property, and Item Property. Dot notation is used to access the available Property for the SubMatches Collection returned by SubMarches Property of Match Object, for example, Syntaxresubmatcolvar.Count resubmatcolvar.Item(key) ExamplesExamples of RegExp Object ASP VbScript Command:
HTML Web Page In-line Output:
Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /internet/users/sideblog/default.asp varsregexv.Pattern, TypeNamec, TypeNamere, TypeNamestrs, TypeNameregexv.Global, TypeNameregexv.IgnoreCase, TypeNameSet regexv = New RegExp: strs="": re="": c=""[], String[], String[], String[], String[False], Boolean[False], Booleanregexv.Pattern="((\w+)@(\w+))\.(\w+)": strs="test@testadd.testcom": re=regexv.Test(strs)[((\w+)@(\w+))\.(\w+)], String[], String[True], Boolean[test@testadd.testcom], String[False], Boolean[False], Booleanstrs="test@testadd.testcom": Set re=regexv.Execute(strs): c=re.Count[((\w+)@(\w+))\.(\w+)], String[1], Long[IMatchCollection2], IMatchCollection2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.item(0)[((\w+)@(\w+))\.(\w+)], String[test@testadd.testcom], String[IMatchCollection2], IMatchCollection2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.item(0).Value[((\w+)@(\w+))\.(\w+)], String[test@testadd.testcom], String[IMatchCollection2], IMatchCollection2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.item(0).FirstIndex[((\w+)@(\w+))\.(\w+)], String[0], Long[IMatchCollection2], IMatchCollection2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.item(0).Length[((\w+)@(\w+))\.(\w+)], String[20], Long[IMatchCollection2], IMatchCollection2[test@testadd.testcom], String[False], Boolean[False], BooleanSet c=re.item(0).SubMatches[((\w+)@(\w+))\.(\w+)], String[ISubMatches], ISubMatches[IMatchCollection2], IMatchCollection2[test@testadd.testcom], String[False], Boolean[False], BooleanSet re=re.item(0): c=re.SubMatches.count[((\w+)@(\w+))\.(\w+)], String[4], Long[test@testadd.testcom], IMatch2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.SubMatches.item(0)[((\w+)@(\w+))\.(\w+)], String[test@testadd], String[test@testadd.testcom], IMatch2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.SubMatches(1)[((\w+)@(\w+))\.(\w+)], String[test], String[test@testadd.testcom], IMatch2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.SubMatches.item(2)[((\w+)@(\w+))\.(\w+)], String[testadd], String[test@testadd.testcom], IMatch2[test@testadd.testcom], String[False], Boolean[False], Booleanc=re.SubMatches(3)[((\w+)@(\w+))\.(\w+)], String[testcom], String[test@testadd.testcom], IMatch2[test@testadd.testcom], String[False], Boolean[False], Boolean |
Sideway BICK Blog 20/05 |