| <!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en"><html><head> | |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2008. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > | |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> | |
| <meta http-equiv="Content-Style-Type" content="text/css"><title>Find/Replace with Regular Expressions</title> | |
| <link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css"></head><body bgcolor="#ffffff"> | |
| <h1 class="Head">Find/Replace with Regular Expressions</h1> | |
| <p> | |
| The <strong>Find</strong> field allows regular expressions as defined by the <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html">Pattern class</a>. | |
| <br>Additionally, it supports \R, which matches any form of line delimiter (Unix, Windows, Mac OS 9). | |
| Note that \R does not work inside []. | |
| </p> | |
| <p> | |
| The <strong>Replace</strong> field allows the following constructs: | |
| </p> | |
| <table border="1" cellpadding="5" summary="supported constructs in the replace field"> | |
| <tbody> | |
| <tr> | |
| <td>$i</td> | |
| <td>inserts | |
| <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html#cg">capturing group</a> | |
| i. | |
| </td> | |
| </tr> | |
| <tr> | |
| <td>\i</td> | |
| <td>inserts | |
| <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html#cg">capturing group</a> | |
| i (same as $i). | |
| </td> | |
| </tr> | |
| <tr> <td>\<i>x</i></td> <td>quotes character <i>x</i> (unless \<i>x</i> has a special meaning)</td> </tr> | |
| <tr> <td>\R</td> <td>inserts the default line delimiter of the document</td> </tr> | |
| <tr> <td>\x<i>hh</i></td> <td>inserts the hexadecimal character <i>hh</i></td> </tr> | |
| <tr> <td>\u<i>hhhh</i></td> <td>inserts the Unicode character <i>hhhh</i></td> </tr> | |
| <tr> <td>\n</td> <td>inserts a newline character (usually, you should use \R instead)</td> </tr> | |
| <tr> <td>\r</td> <td>inserts a carriage-return character (usually, you should use \R instead)</td> </tr> | |
| <tr> <td>\t</td> <td>inserts a tab character</td> </tr> | |
| <tr> <td>\f</td> <td>inserts a form-feed character</td> </tr> | |
| <tr> <td>\a</td> <td>inserts an alert (beep) character</td> </tr> | |
| <tr> <td>\e</td> <td>inserts an escape character</td> </tr> | |
| <tr> <td>\c<i>C</i></td> <td>inserts a the control character for <i>C</i></td> </tr> | |
| <tr> <td>\C</td> <td>retains the casing of the match (all lower case, all upper case, capitalized)</td> </tr> | |
| </tbody> | |
| </table> | |
| </body></html> |