正規表示式

2021-04-08 23:49:00 字數 2463 閱讀 9074

/**/

//////

頁面資料校驗類 

///李天平 

///2004.8 

///

public

class

pagevalidate 

...數字字串檢查

#region

數字字串檢查               

/**/

//////

檢查request查詢字串的鍵值,是否是數字,最大長度限制 

//////

request

///request的鍵值

///最大長度

///返回request查詢字串

是否數字字串 

//////

輸入字串

///public

static

bool

isnumber(

string

inputdata) 

.../**/

//////

是否數字字串可帶正負號 

//////

輸入字串

///public

static

bool

isnumbersign(

string

inputdata) 

.../**/

//////

是否是浮點數 

//////

輸入字串

///public

static

bool

isdecimal(

string

inputdata) 

.../**/

//////

是否是浮點數可帶正負號 

//////

輸入字串

///public

static

bool

isdecimalsign(

string

inputdata) 

...#endregion

中文檢測

#region

中文檢測 

/**/

//////

檢測是否有中文字元 

//////

///public

static

bool

ishaschzn(

string

inputdata) 

...#endregion

郵件位址

#region

郵件位址 

/**/

//////

是否是浮點數可帶正負號 

//////

輸入字串

///public

static

bool

isemail(

string

inputdata) 

...#endregion

其他#region

其他 /**/

//////

檢查字串最大長度,返回指定長度的串 

//////

輸入字串

///最大長度

///public

static

string

sqltext(

string

sqlinput, 

intmaxlength) 

...return

sqlinput; 

}/**/

//////

字串編碼 

//////

///public

static

string

htmlencode(

string

inputdata) 

.../**/

//////

設定label顯示encode的字串 

//////

///public

static

void

setlabel(label lbl, 

string

txtinput) 

...public

static

void

setlabel(label lbl, 

object

inputobj) 

...#endregion}

正規表示式 正規表示式 總結

非負整數 d 正整數 0 9 1 9 0 9 非正整數 d 0 負整數 0 9 1 9 0 9 整數 d 非負浮點數 d d 正浮點數 0 9 0 9 1 9 0 9 0 9 1 9 0 9 0 9 0 9 1 9 0 9 非正浮點數 d d 0 0 負浮點數 正浮點數正則式 英文本串 a za z...

正規表示式 表示式

網域名稱 a za z0 9 a za z0 9 a za z0 9 a za z0 9 interneturl a za z s 或 http w w w 手機號碼 13 0 9 14 5 7 15 0 1 2 3 5 6 7 8 9 18 0 1 2 3 5 6 7 8 9 d 號碼 x x x...

Linux正規表示式 編寫正規表示式

為了所有實用化的用途,你可以通過使用程式產生正確的結果。然而,並不意味著程式總是如你所願的那樣正確地工作。多數情況下,如果程式不能產生想要的輸出,可以斷定真正的問題 排除輸入或語法錯誤 在於如何描述想要的東西。換句話說,應該考慮糾正問題的地方是描述想要的結果的表示式。表示式不完整或者公式表示得不正確...