Text Replacer
Professional text replacement tool supporting normal text and regex replacement, with file upload support
Search and Replace
Replace Options
Usage Instructions
Basic Features
Normal Text Replace
Directly enter text content to find and replace
Regular Expression Replace
Use regular expressions for complex pattern matching and replacement
File Upload Processing
Support uploading text files for batch processing
Regular Expression Examples
Match email address:
\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\bMatch phone number:
1[3-9]\d{9}Match numbers:
\d+Match whitespace:
\s+Regex Flags Explanation
Global match
Global match - Find all matches in the text rather than stopping after the first match. Without this flag, only the first occurrence will be replaced.
Case insensitive
Case insensitive - Ignore uppercase and lowercase differences when matching. For example, pattern 'abc' will match 'ABC', 'Abc', 'aBc', etc.
Multiline mode
Multiline mode - Changes the behavior of ^ and $. By default, they match the start/end of the entire string. With this flag, they match the start/end of each line.
Dot matches newline
Dot matches newline - By default, the dot (.) matches any character except newline (\n). With this flag, dot will also match newline characters.
Unicode mode
Unicode mode - Enables full Unicode support. Required for correctly handling Unicode characters like emojis, Chinese characters, and surrogate pairs.
Sticky match
Sticky match - Matches only at the exact position indicated by the lastIndex property. Unlike global flag, it doesn't search forward for the next match.
Usage Scenarios
Data Cleaning
Clean and standardize data format, remove unwanted characters
Code Refactoring
Batch modify variable names, function names or code structure
Document Processing
Unify document format, replace specific content or markers
Notes
- When using regular expressions, ensure the syntax is correct. Incorrect regex may cause unexpected results
- It is recommended to test on a small scale before processing important files
- Large file processing may take a long time, please be patient
- Supported file formats: .txt, .csv, .json, .xml, .log, .md
- File size is recommended not to exceed 10MB for optimal performance