Using System;
Using System.Text.RegularExpressions;
Namespace Bobomousecom.crm
{
<summary>
Summary description of the regexlib.
</summary>
public class Regexlib
{
Public Regexlib ()
{
//
TODO: Add constructor logic here
//
}
Search the input string and return all href= "..." values
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]);
}
}
The Dd-mm-yy date form replaces the Mm/dd/yy date form.
String mdytodmy (String input)
{
return Regex.Replace (Input, "\\b (? \\d{1,2})/(? \\d{1,2})/(? \\d{2,4}) \\b", "${day}-${month}-${year}");
}
Verify that you are a decimal
BOOL Isvaliddecimal (String strin)
{
Verify that you are a phone number
BOOL Isvalidtel (String strin)
{
return Regex.IsMatch (strin,@) (\d+-)? ( \d{4}-?\d{7}|\d{3}-?\d{8}|^\d{7,8}) (-\d+)? ");
}
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.