| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html lang="en"> | |
| <head> | |
| <meta name="copyright" content= | |
| "Copyright (c) IBM Corporation and others 2008, 2012. 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=utf-8" /> | |
| <meta http-equiv="Content-Style-Type" content="text/css" /> | |
| <title> | |
| Supported Regular Expressions | |
| </title> | |
| <link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type= | |
| "text/css" /> | |
| </head> | |
| <body> | |
| <h1 class="Head"> | |
| Supported Regular Expressions | |
| </h1> | |
| <p> | |
| When searching for text you can use the regular expressions as defined by | |
| the <a href= | |
| "https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html">Pattern | |
| class</a>.<br /> | |
| Additionally, \R can be used to match any form of line delimiter (Unix, | |
| Windows, Classic Mac OS). Note that \R does not work in character groups ([]). | |
| </p> | |
| <p> | |
| The replace string 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= | |
| "https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html#cg"> | |
| capturing group</a> i. | |
| </td> | |
| </tr> | |
| <tr> | |
| <td> | |
| \i | |
| </td> | |
| <td> | |
| inserts <a href= | |
| "https://docs.oracle.com/en/java/javase/11/docs/api/java.base/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>X</i> | |
| </td> | |
| <td> | |
| inserts the control character for <i>X</i> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td> | |
| \C | |
| </td> | |
| <td> | |
| retains the casing of the match (all lower case, all upper case, | |
| capitalized) for the rest of the replace string | |
| </td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </body> | |
| </html> |