# HG changeset patch # User kellrott # Date 1353305046 18000 # Node ID 9a77d5fca67cfe3acfaa0d26611c51fd220b55fb Uploaded diff -r 000000000000 -r 9a77d5fca67c regex_replace.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/regex_replace.xml Mon Nov 19 01:04:06 2012 -0500 @@ -0,0 +1,120 @@ + + Regular Expression replacement using the Python re module + $script_file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Perform regular expression replacement using the Python re engine. + +Example: +======== + Search String:: + + [^\s]+_(\w+).* + + Replace String:: + + \1 + + On the input file:: + + LJP001_BT20_24H:DMSO + LJP001_BT20_24H:H20 + LJP001_BT20_6H:DMSO + + Outputs:: + + 24H + 24H + 6H + +Additional Options +================== + +Replace Count: + Will define the number of occurrences that can be replaced by the substitution. A count of 0 is equivalent + to 'replace all' + + +Ignore Case: + Make searches case insensitive + +Multi-line: + Do the search across the entire contents of the file. If not checked, then replacements occur line by line + +Dot-All: + With this checked, the '.' in a matching pattern will also match new-line characters. Generally used with 'multi-line' search + + +