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 |
([{\^-$|]})?*+.。注æ„,在æŸäº›æ—¶å€™è¿™äº›ç‰¹ŒDŠçš„å—符òq¶ä¸ä¸€å®šä»£è¡¨ç‰¹ŒDŠå«ä¹‰ï¼Œä¾‹å¦‚ - 在[a-c]䏿˜¯å…ƒå—½W¦ï¼Œä½†åœ¨ a-c 则ä¸è¡¨ç¤ºç‰ÒŽ®Šå«ä¹‰ã€‚丘q‡ä¸Šé¢æ²¡åˆ—出的嗽W¦åˆ™ä¸€å®šä¸ä¼šä»£è¡¨ç‰¹ŒDŠå«ä¹‰ã€?br />
2ã€å¯ä»¥å¯¹å…ƒå—½W¦è¿›è¡Œè{ä¹‰ï¼Œä¸»è¦æœ‰ä¸¤¿U方法:
[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 åQ?tt>psdkdir\Bin
Include files åQ?tt>psdkdir\include
Library filesåQ?tt>psdkdir\lib
Include files åQ?tt>WpdPackPath\include
Library filesåQ?tt> WpdPackPath\lib