Collections:
Regular Expression Search and Replace
How to perform regular expression Search and Replace?
To perform a regular expression pattern Search and Replace, you need to write a pattern string in regular expression language, and a replacement string. Then you need to apply the pattern search and replacement to the subject string with a tool, which returns the modified subject string.
FYIcenter.com has designed this online tool for you to perform regular expression pattern match search and replace. All you need to do is to enter your subject string, the pattern, the replacement, and the modifier. Then click the "Submit" button. The modified subject string will be displayed in the result area.
✍: FYIcenter.com
Modified subject returned by FYIcenter.com:
Subject with Replacement:
Subject with Replacement:
How to reference sub-matches in replacement?
If you want to reference a sub-match in the replacement string, you need to the "$n" expression.
For example, "(\d\d)-([A-Z][a-z]{2})-(\d\d\d\d)" is a regular expression pattern with 3 sub-matches. You can reference them to convert date strings to a different format like "$2 $1, $3".
⇐ Regular Expression Pattern Match Multiple Occurrences
⇑ Regular Expression Match and Replace
⇑⇑ Online Tools
2018-01-13, 3013👍, 0💬
Popular Posts:
How to generate ISBN numbers? To help you to obtain some ISBN numbers for testing purpose, FYIcenter...
Where to find tutorials on Apache JMeter test tool? I want to know how to use Apache JMeter. Here is...
How to convert hexadecimal encoded data back to binary data (or Hex to Binary Decoding)? Hex to Bina...
How to validate domain name format? In order to help your programming or testing tasks, FYIcenter.co...
How to validate credit card numbers? In order to help your programming or testing tasks, FYIcenter.c...