Find and replace text with regex support, capture groups, whole-word matching, and case-insensitive mode. Replace all occurrences or just the first.
Options
Enter text and click Replace
Plain replacement handles simple substitutions, while regular expressions describe patterns such as IDs, whitespace, or email-like strings. Use capture groups in replacement text with $1, $2, and later references.
| Option | Effect |
|---|---|
| Plain text | Escapes regex characters automatically |
| Regex | Uses JavaScript regular-expression syntax |
| Case insensitive | Matches letter case variants |
| Whole word | Adds word boundaries in plain-text mode |
text.replace(/hello/gi, "hi");
import re
result = re.sub(r"hello", "hi", text, flags=re.I)
Test complex patterns against representative input before applying replacements to production files. Invalid expressions are reported instead of changing output.
This tool is provided for general informational and utility purposes only. Results may be inaccurate, incomplete, outdated, or contain errors. Always verify results before relying on or using them.
Some tools may use AI, automated processing, third-party services, or server-side processing. Do not rely on these tools as a substitute for professional advice.
Use at your own risk. BestToolOnline makes no guarantees regarding the accuracy, reliability, completeness, availability, or suitability of results, to the maximum extent permitted by applicable law.
See our Terms of Service and Privacy Policy for complete details.