2012/03/23

C# Regular Expression Examples

───────────────────────────────────────

http://renjin.blogspot.com/2008/08/regular-expression-examples.html

http://219.85.62.1/Canred/showtopic.aspx?topicid=1229




"^\\d+$"  //非負整數(正整數 + 0)

"^[0-9]*[1-9][0-9]*$"  //正整數

"^((-\\d+)|(0+))$"  //非正整數(負整數 + 0)

"^-[0-9]*[1-9][0-9]*$"  //負整數

"^-?\\d+$"    //整數

"^\\d+(\\.\\d+)?$"  //非負浮點數(正浮點數 + 0)


"^(([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+)?))$"  //非正浮點數(負浮點數 + 0)


"^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-
 9]*)))$"
//負浮點數

"^(-?\\d+)(\\.\\d+)?$"  //浮點數

"^[A-Za-z]+$"  //由26個英文字母組成的字符串

"^[A-Z]+$"  //由26個英文字母的大寫組成的字符串

"^[a-z]+$"  //由26個英文字母的小寫組成的字符串

"^[A-Za-z0-9]+$"  //由數字和26個英文字母組成的字符串

"^\\w+$"  //由數字、26個英文字母或者下劃線組成的字符串

"^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$"    //email地址

"^[a-zA-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\S*)?$"  //url

--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 61.224.49.164

37 Tested Regular Expressions

http://www.virtuosimedia.com/dev/php/37-tested-php-perl-and-javascript-regular-expressions

2012/03/19

Array in C#

知道Array怎麼運作

但是好像不太習慣C#/Java的Array宣告方式 XD (跟平常比較多寫js/as有關係嗎? XD)


一維陣列 (C# 程式設計手冊)
http://msdn.microsoft.com/zh-tw/library/0a7fscd0(VS.80).aspx

宣告:
int[] array = new int[5];
string[] stringArray = new string[6];

初始化:
int[] array1 = new int[5] { 1, 3, 5, 7, 9 };
string[] weekDays = new string[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
"Sat" };

或是不用new一個陣列直接塞值進去

int[] array2 = { 1, 3, 5, 7, 9 };
string[] weekDays2 = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };


BUT 將陣列指派給這個變數時,就必須使用 new 運算子。例如:

int[] array3;
array3 = new int[] { 1, 3, 5, 7, 9 };   // OK
//array3 = {1, 3, 5, 7, 9};   // Error


另外二維以上多維陣列宣告法為 int[維度] ary = new int[長度]


int[,] array = new int[4, 2];

int[, ,] array1 = new int[4, 2, 3];

--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 114.36.63.151

2012/03/08

HTML5 & CSS3 懶人包

HTML5 & CSS3 懶人包

1.Ryan的線上講義
http://www.slideshare.net/ryan/html5-basic
http://www.slideshare.net/ryan/some-html5-samples
http://www.slideshare.net/ryan/css3-basic

2.入門看這裡
http://www.w3schools.com/html5/default.asp
http://www.w3schools.com/css3/default.asp

3.延伸閱讀
http://www.html5rocks.com/en/
http://diveintohtml5.info/

4.相容分析
http://caniuse.com/
http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML5)

5.中文參考書
http://www.tenlong.com.tw/items/9574428656?item_id=57719
http://www.tenlong.com.tw/items/9862014504?item_id=244059

6.高級範例
http://www.apple.com/html5/

--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 114.36.53.174
→ pxxxxxxg:W3School 要小心...  另外我自己是都看 MDN            推 03/09 00:50
→ Corsair:MDN是....?                                           推 03/09 12:38
→ pxxxxxxg:https://developer.mozilla.org/zh-TW/                推 03/11 01:29
→ Corsair:m(_  _)m  謝謝光大大                                 推 03/11 02:06