Lines 26 - 31 |
Lines 26 - 45 |
|
|
|
|
+++ Common patterns |
+++ Common patterns |
|
|
|
**Matching empty** |
|
|
|
What, if you want to match "nothing"? [http://suggestions.yahoo.com/detail/?prop=Pipes&fid=96717 Hapdaniel] has the solution: |
|
|
|
* [^(?!.)] |
|
|
|
|
|
**Matching not empty** |
|
|
|
And here's the opposite, again from the suggestion thread. |
|
|
|
* [^(?=.)] |
|
|
|
|
**Removing whitespace** |
**Removing whitespace** |
|
|
Lines 56 - 62 |
Lines 70 - 76 |
* [()] -- groups. You can use the groups matched in the replacement field. For example replace [(\d)] with [0$1] results in a leading zero added. |
* [()] -- groups. You can use the groups matched in the replacement field. For example replace [(\d)] with [0$1] results in a leading zero added. |
* [[]] -- character groups. For example, [123] matches 1, 2 or 3. |
* [[]] -- character groups. For example, [123] matches 1, 2 or 3. |
|
|
* [^\d] -- combination. ^ means not, \d means digit. So one character, being everything but a digit, is matched here |
* [!\d] -- combination. ! means not, \d means digit. So one character, being everything but a digit, is matched here |
* [\d*] -- '*' means: 0 to n matches. This would match no or up to infinite digits. |
* [\d*] -- '*' means: 0 to n matches. This would match no or up to infinite digits. |
* [\d+] -- '+' means: 1 to n matches. At least one. This would match one or more digits. |
* [\d+] -- '+' means: 1 to n matches. At least one. This would match one or more digits. |
|
|