Regular Expression एक Pattern है जिसे Input Text के विरुद्ध Match किया जा सकता है। Characters, Operators, और Constructs की विभिन्न Categories हैं जो आपको Regular Expressions Define करने देती हैं। Substitutions का उपयोग Replacement Patterns में किया जाता है।
निम्न Table Substitutions को List करती है।
| Character | Description | Pattern | Replacement Pattern | Input String | Resulting String |
|---|---|---|---|---|---|
| $number | Group Number द्वारा Matched Substring को Substitute करता है। | \b(\w+)(\s)(\w+)\b | $3$2$1 | "one two" | "two one" |
| ${name} | Named Groupname द्वारा Matched Substring को Substitute करता है। | \b(? | ${word2} ${word1} | "one two" | "two one" |
| $$ | Literal "$" को Substitute करता है। | \b(\d+)\s?USD | $$$1 | "103 USD" | "$103" |
| $& | Whole Match की Copy को Substitute करता है। | (\$*(\d*(\.+\d+)?){1}) | **$& | "$1.30" | "**$1.30**" |
| $` | Match से पहले Input String के सभी Text को Substitute करता है। | B+ | $` | "AABBCC" | "AAAACC" |
| $' | Match के बाद Input String के सभी Text को Substitute करता है। | B+ | $' | "AABBCC" | "AACCCC" |
| $+ | Last Captured Group को Substitute करता है। | B+(C+) | $+ | "AABBCCDD" | AACCDD |
| $_ | Entire Input String को Substitute करता है। | B+ | $_ | "AABBCC" | "AAAABBCCC |