RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details VBScript Declaration
Expression
^[\s]*(?:(Public|Private)[\s]+(?:[_][\s]*[\n\r]+)?)?(Function|Sub)[\s]+(?:[_][\s]*[\n\r]+)?([a-zA-Z][\w]{0,254})(?:[\s\n\r_]*\((?:[\s\n\r_]*([a-zA-Z][\w]{0,254})[,]?[\s]*)*\))?
Description
Matches any VBScript method declaration (= no "As [datatype]" support), supports line wraps, only matches valid argument/method names, Public/Private and arguments are optional. First regex, please comment ;)
Matches
Sub Test() | Public Sub Test(arg1, arg2) | Public Sub _\r\nTest(arg1, arg2)
Non-Matches
"Function test()" | Sub 0815() | Sub_Test() | Sub Test(0815)
Author Rating: Not yet rated. Laurens Stötzel
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials