Search for a tool
Regular Expression Replacement

Tool to find and replace by regular expression (regexp/regex) in text, message, or document to perform the corresponding replacements.

Results

Regular Expression Replacement -

Tag(s) : Data Processing

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Regular Expression Replacement' tool for free! Thank you!

Regular Expression Replacement

Regexp Search and Replace

Answers to Questions (FAQ)

What is a regular expression replacement? (Definition)

It is a search and replace operation, but using a search by regular expression (or rational expression or regexp) that makes it possible to extract subsets of strings respecting a precise description. Regular expression replacements allow the ability of this search to be coupled with replacement capabilities based on the results of the search.

Example: ([a-z])[a-z] describes a set of any 2 consecutive letters. Replacing with $1 makes it possible to retain only the first letter.

What is a back-reference?

Parentheses are used to number and reference their contents. Each captured parenthesis encountered will thus be associated with a back reference.

A back reference is therefore a reference to a capturing submask defined previously (in parentheses).

The reference is noted with a backslash or with a dollar followed by a number greater than 0 and often limited to 9 or 99).

Example: The regex ((A)BC) will capture ABC in \1 and A in \2.

Source code

dCode retains ownership of the "Regular Expression Replacement" source code. Any algorithm for the "Regular Expression Replacement" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Regular Expression Replacement" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Regular Expression Replacement" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Regular Expression Replacement" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source. Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link: https://www.dcode.fr/regexp-replacement
In a scientific article or book, the recommended bibliographic citation is: Regular Expression Replacement on dCode.fr [online website], retrieved on 2025-04-16, https://www.dcode.fr/regexp-replacement

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Regular Expression Replacement' tool for free! Thank you!


https://www.dcode.fr/regexp-replacement
© 2025 dCode — The ultimate collection of tools for games, math, and puzzles.
 
Feedback