skip to main content

kiesler.at
YahooPipesRegex
Back to Page | Back to History

Difference between revisions

Version 4, 2008-06-27 11:50 Version 5, 2008-06-27 11:56
Lines 19 - 24 Lines 19 - 28
* **i** be case insensitive. set='A' equals 'a'; unset 'A' and 'a' are treated differently * **i** be case insensitive. set='A' equals 'a'; unset 'A' and 'a' are treated differently
* **m** treat string as multiple lines. set='^' matches every start of string after a \n and/or \r . unset='^' matches only the very first character in the string. * **m** treat string as multiple lines. set='^' matches every start of string after a \n and/or \r . unset='^' matches only the very first character in the string.
* **s** allow '.' to match new lines as well. set='.' matches '\n'. unset='.' does not match '\n'. * **s** allow '.' to match new lines as well. set='.' matches '\n'. unset='.' does not match '\n'.
   
  **Alternate Notation**
   
  [http://discuss.pipes.yahoo.com/Message_Boards_for_Pipes/threadview?m=te&bn=pip-DeveloperHelp&tid=4415&mid=4415&tof=131&frt=2#4415 Hapdaniel] from the Yahoo Pipes Discussions points out, that there is an alternate form of specifying those flags as well. you can for example prefix your RegEx with a (?g) to get the +g flag set.
   
   
+++ Common patterns +++ Common patterns
Lines 90 - 93 Lines 94 - 104
* Replace [(\d\d)\/(\d\d)\/(\d\d)] with [20$3-$1-$2] * Replace [(\d\d)\/(\d\d)\/(\d\d)] with [20$3-$1-$2]
   
Here, we have three groups. In the result, I also prefix a "20" as the year was specified only with two digits. Here, we have three groups. In the result, I also prefix a "20" as the year was specified only with two digits.
   
   
  **Convert to Uppercase**
   
  Also from a [http://discuss.pipes.yahoo.com/Message_Boards_for_Pipes/threadview?m=te&bn=pip-DeveloperHelp&tid=4349&mid=4349&tof=159&frt=2#4349 Yahoo Pipes Discussion]. You can use the \U flag to convert something to uppercase. For example
   
  * replace [(.*)] with [\U$1]