I’ve decided to release phreplace as open source software in order to continue it’s development, I no longer have the time to give it the attention it deserves. The VB6 source code will be released under the GNU Lesser General Public License (LGPL), in my understanding this means that anyone can use phreplace and even [...]
more...Regular Expressions
phreplace uses the vbscript regular expression engine, for more information on pattern matching, see the following Microsoft reference:
Microsoft Beefs Up VBScript with Regular Expressions
Note that the full stop (.) matches any character except \n. This means it also matches \r which can cause issues with Windows encoding which uses \r\n as the line break.
Backreferences
To use search matches in a replace term, surround the match you wish to use in parenthesis (brackets) and use $1, $2, $3 etc… in the replace term. e.g.
| Text: | The quick brown fox jumps over the lazy dog |
| Search: | The quick brown (\w*) jumps over the lazy (\w*) |
| Replace: | The $1 $2 |
| Result: | The fox dog |
Use $& to match the entire search match.
Use $1, $2, etc. To match backreferences (parenthesis) in the search match.
Examples
Search: ^([^\n\r]+)$
Description: Matches a whole line.

