| Replacement Reference |
| Introduction |
| Table of Contents |
| Characters |
| Matched Text & Backreferences |
| Case Conversion |
| Context |
| Conditionals |
| Regular Expressions Reference |
| Feature | Syntax | Description | Example | JGsoft | Python | JavaScript | VBScript | XRegExp | .NET | Java | ICU | RE2 | Perl | PCRE2 | PHP | Delphi | R | Ruby | std::regex | Boost | Tcl | Oracle | XPath |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Case Conversion | \U0 and \U1 through \U99 | Insert the whole regex match or the 1st through 99th backreference with all letters in the matched text converted to uppercase. | Replacing .+ with \U0 in HeLlO WoRlD yields HELLO WORLD | YES | 3.7 error | no | no | no | no | no | no | error | no | no | no | YES | no | no | no | no | no | no | error |
| Case Conversion | \L0 and \L1 through \L99 | Insert the whole regex match or the 1st through 99th backreference with all letters in the matched text converted to lowercase. | Replacing .+ with \L0 in HeLlO WoRlD yields hello world | YES | 3.7 error | no | no | no | no | no | no | error | no | no | no | YES | no | no | no | no | no | no | error |
| Case Conversion | \F0 and \F1 through \F99 | Insert the whole regex match or the 1st through 99th backreference with the first letter in the matched text converted to uppercase and the remaining letters converted to lowercase. | Replacing .+ with \F0 in HeLlO WoRlD yields Hello world | YES | 3.7 error | no | no | no | no | no | no | error | no | extended error | no | YES | no | no | no | no | no | no | error |
| Case Conversion | \I0 and \I1 through \I99 | Insert the whole regex match or the 1st through 99th backreference with the first letter of each word in the matched text converted to uppercase and the remaining letters converted to lowercase. | Replacing .+ with \I0 in HeLlO WoRlD yields Hello World | YES | 3.7 error | no | no | no | no | no | no | error | no | extended error | no | YES | no | no | no | no | no | no | error |
| Case Conversion | All literal text and all text inserted by replacement text tokens after up to the next or is converted to uppercase. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO WoRlD yields HELLO CRUEL WoRlD | no | 3.7 error | no | no | no | no | no | no | error | YES | extended | no | no | no | no | no | all default | no | no | error | |
| Case Conversion | All literal text and all text inserted by replacement text tokens after up to the next or is converted to lowercase. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO WoRlD yields hello cruel WoRlD | no | 3.7 error | no | no | no | no | no | no | error | YES | extended | no | no | no | no | no | all default | no | no | error | |
| Case Conversion | The first character after that is inserted into the replacement text as a literal or by a token is converted to uppercase. | Replacing (\w+) (\w+) with $1 cRuEl $2 in hElLo wOrLd yields HElLO CRuEl WOrLd | no | 3.7 error | no | no | no | no | no | no | error | YES | extended | no | no | no | no | no | all default | no | no | error | |
| Case Conversion | The first character after that is inserted into the replacement text as a literal or by a token is converted to lowercase. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO WoRlD yields heLlO crUeL woRlD | no | 3.7 error | no | no | no | no | no | no | error | YES | extended | no | no | no | no | no | all default | no | no | error | |
| Case Conversion | The first character after that is inserted into the replacement text as a literal or by a token is converted to uppercase and the following characters up to the next or are converted to lowercase. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO wOrLd yields Hello Cruel WOrLd | no | 3.7 error | no | no | no | no | no | no | error | YES | extended 10.45 | no | no | no | no | no | no | no | no | error | |
| Case Conversion | The first character after that is inserted into the replacement text as a literal or by a token is converted to lowercase and the following characters up to the next or are converted to uppercase. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO WoRlD yields hELLO cRUEL woRlD | no | 3.7 error | no | no | no | no | no | no | error | YES | extended 10.45 | no | no | no | no | no | no | no | no | error | |
| Case Conversion | The first character after that is inserted into the replacement text as a literal or by a token is converted to uppercase and the following characters up to the next or are converted to lowercase. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO wOrLd yields Hello Cruel WOrLd | no | 3.7 error | no | no | no | no | no | no | error | no | no | no | no | no | no | no | all default | no | no | error | |
| Case Conversion | The first character after that is inserted into the replacement text as a literal or by a token is converted to lowercase and the following characters up to the next or are converted to uppercase. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO WoRlD yields hELLO cRUEL woRlD | no | 3.7 error | no | no | no | no | no | no | error | no | no | no | no | no | no | no | all default | no | no | error | |
| Case Folding | Unicode case folding is applied to all literal text and all text inserted by replacement text tokens after up to the next , , or . Case folding converts most characters to lowercase, but some to uppercase or to alternative lowercase characters. | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO WoRlD yields hello cruel WoRlD | no | 3.7 error | no | no | no | no | no | no | error | 5.16 | extended error | no | no | no | no | no | no | no | no | error | |
| Case Folding | The first character after that is inserted into the replacement text as a literal or by a token is converted to uppercase. Unicode case folding is applied to all following characters up to the next , , or . | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO wOrLd yields Hello Cruel WOrLd | no | 3.7 error | no | no | no | no | no | no | error | 5.16 | extended error | no | no | no | no | no | no | no | no | error | |
| Case Folding | The first character after that is inserted into the replacement text as a literal or by a token is converted to lowercase. Unicode case folding is applied to all following characters up to the next , , or . | Replacing (\w+) (\w+) with $1 CrUeL $2 in HeLlO WoRlD yields hello cruel woRLD | no | 3.7 error | no | no | no | no | no | no | error | 5.16 | extended error | no | no | no | no | no | no | no | no | error | |
| Feature | Syntax | Description | Example | JGsoft | Python | JavaScript | VBScript | XRegExp | .NET | Java | ICU | RE2 | Perl | PCRE2 | PHP | Delphi | R | Ruby | std::regex | Boost | Tcl | Oracle | XPath |
| Quick Start | Tutorial | Search & Replace | Tools & Languages | Examples | Reference |
| Introduction | Table of Contents | Characters | Matched Text & Backreferences | Case Conversion | Context | Conditionals | Regular Expressions Reference |
Page URL: https://www.regular-expressions.info/refreplacecase.html
Page last updated: 23 May 2025
Site last updated: 29 October 2025
Copyright © 2003-2025 Jan Goyvaerts. All rights reserved.