It is an expression of the class
Using System;
Namespace Regexlib (
/ / / (Public class Regexlib
Public Regexlib () (
/ / / / TODO: Add constructor function in the logic here / /
)
/ / String search and return to the importation of all href value ="…"
String DumpHrefs (String inputString) (
Regex r;
Match m;
R = new Regex ( "href \ \ s *= \ \ s * (?: \" (? <1> [^ \ "] *) \ "|(?< 1> \ \ S +))",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
For (m = r.Match (inputString);
M.Success; m = m.NextMatch ()) (
Return ( "Found href" + m.Groups [1]);
)
)
/ / Validation Email Address
Bool IsValidEmail (string strIn) (
/ / Return true if strIn is in valid e-mail format.
Return Regex.IsMatch (strIn,"^([ \ w-\ .]+)@(( \ [[0-9] (1,3) \. [0-9] (1,3) \. [ 0-9] (1,3) \ .)|(([ \ w-] + \ .)+))([ a-zA-Z] (2,4) | [0-9] (1,3 )) (\ ]?)$");
)
/ / Dd-mm-yy date format instead of mm / dd / yy date format.
String MDYToDMY (String input) (
Return Regex.Replace (input, "\ \ b (? )
/ / Verify whether the minority
Bool IsValidDecimal (string strIn) (
Return Regex.IsMatch (strIn, @ "[0]. \ D (1,2) | [1]");
)
/ / Verify whether the telephone numbers
Bool IsValidTel (string strIn) (
Return Regex.IsMatch (strIn, @ "(\ d +-)?( \ d (4) -? \ D (7) | \ d (3) -? \ D (8) | ^ \ d (7,8) ) (- \ d +)?");
)
/ / Validation Date
Bool IsValidDate (string strIn) (
Return Regex.IsMatch (strIn, @ "^ 2 \ d (3 }-(?: 0? [1-9] | 1 [0-2 ])-(?: 0? [1-9] | [1 — 2] \ d | 3 [0-1 ])(?: 0? [1-9] | 1 \ d | 2 [0-3 ]):(?: 0? [1-9] | [1-5 ] \ d ):(?: 0? [1-9] | [1-5] \ d )$");
)
/ / Validation of suffix
Bool IsValidPostfix (string strIn) (
Return Regex.IsMatch (strIn, @ "\. (? I: gif | jpg )$");
)
/ / Verify whether the characters again between 4-12
Bool IsValidByte (string strIn) (
Return Regex.IsMatch (strIn ,@"^[ az] (4, 12 }$");
)
/ / Verification IP
Bool IsValidIp (string strIn) (
Return Regex.IsMatch (strIn ,@"^( \ d (1,2) | 1 \ d \ d | 2 [0-4] \ d | 25 [0-5]) \. (\ D (1,2 ) | 1 \ d \ d | 2 [0-4] \ d | 25 [0-5]) \. (\ d (1,2) | 1 \ d \ d | 2 [0-4] \ d | 25 [0-5]) \. (\ d (1,2) | 1 \ d \ d | 2 [0-4] \ d | 25 [0-5 ])$");
)
)
)
Reprint: http://dotnet.mblogger.cn/commansource/posts/383.aspx
Tags: expressionReleated Articles








0 Comments to “It is an expression of the class”
No Comments. Send your comment.
Leave a Reply
You must be logged in to post a comment.