writer =newFileWriter("output.txt")
newFile("Hello.txt").eachLine {
line ->if(line !='') {
writer.write((newString(line.getBytes("GBK")))+'r\n')
}
}
writer.close()
def age =25
print"Myageis:"
println age
println"Myageis:${age}"
print"Pleaseenteryourname:"
name =newInputStreamReader(System.in).readLine()
println"Mynameis:${name}"
聽Meaning | |||
聽Greedy | 聽Reluctant | 聽Possessive | |
聽X? |
聽X?? |
聽X?+ |
聽X , once or not at all |
聽X* |
聽X*? |
聽X*+ |
聽X , zero or more times |
聽X+ |
聽X+? |
聽X++ |
聽X , one or more times |
聽X{n} |
聽X{n}? |
聽X{n}+ |
聽X , exactly n times |
聽X{n,} |
聽X{n,}? |
聽X{n,}+ |
聽X , at least n times |
聽X{n,m} |
聽X{n,m}? |
聽X{n,m}+ |
聽X , at least n but not
more than m times |
([{\^-$|]})?*+.銆傛敞鎰忥紝鍦ㄦ煇浜涙椂鍊欒繖浜涚壒孌婄殑瀛楃騫朵笉涓瀹氫唬琛ㄧ壒孌婂惈涔夛紝渚嬪 - 鍦╗a-c]涓槸鍏冨瓧絎︼紝浣嗗湪 a-c 鍒欎笉琛ㄧず鐗規畩鍚箟銆備笉榪囦笂闈㈡病鍒楀嚭鐨勫瓧絎﹀垯涓瀹氫笉浼氫唬琛ㄧ壒孌婂惈涔夈?br />
2銆佸彲浠ュ鍏冨瓧絎﹁繘琛岃漿涔夛紝涓昏鏈変袱縐嶆柟娉曪細
[abc] | a, b, or c (simple class) |
[^abc] | Any character except a, b, or c (negation) |
[a-zA-Z] | a through z, or A through Z, inclusive (range) |
[a-d[m-p]] | a through d, or m through p: [a-dm-p] (union) |
[a-z&&[def]] | d, e, or f (intersection) |
[a-z&&[^bc]] | a through z, except for b and c: [ad-z] (subtraction) |
[a-z&&[^m-p]] | a through z, and not m through p: [a-lq-z] (subtraction) |
. | Any character (may or may not match line terminators) |
\d |
A digit: [0-9] |
\D |
A non-digit: [^0-9] |
\s |
A whitespace character: [ \t\n\x0B\f\r] |
\S |
A non-whitespace character: [^\s] |
\w |
A word character: [a-zA-Z_0-9] |
\W | A non-word character: [^\w] |
Executalbe files 錛?tt>psdkdir\Bin
Include files 錛?tt>psdkdir\include
Library files錛?tt>psdkdir\lib
Include files 錛?tt>WpdPackPath\include
Library files錛?tt> WpdPackPath\lib