w

Frequently Asked Questions

General Questions

What is the Text Replacer tool?

The Text Replacer is an online tool that allows you to find and replace text using both literal text matching and regular expressions. It provides real-time preview, history tracking, and supports complex pattern matching.

Is my data secure?

Yes, absolutely. All text processing happens entirely in your browser. Your data never leaves your device and is not transmitted to any servers. The tool is completely client-side for maximum privacy and security.

What browsers are supported?

The Text Replacer works in all modern browsers including:

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

Is there a file size limit?

There's no strict file size limit, but very large texts (over 1MB) may impact browser performance. For best results, process large files in smaller chunks.

Regular Expression Questions

What regex features are supported?

The tool supports JavaScript regular expressions, including:

  • Character classes (\w, \d, \s, etc.)
  • Quantifiers (*, +, ?, {n,m})
  • Anchors (^, $, \b)
  • Capture groups ((), $1, $2, etc.)
  • Lookahead/lookbehind assertions
  • All standard flags (g, i, m, s)

How do I escape special characters?

Use backslashes to escape special regex characters:

  • \. for literal period
  • \+ for literal plus sign
  • \* for literal asterisk
  • \( and \) for literal parentheses
  • \[ and \] for literal square brackets

What's the difference between greedy and lazy matching?

  • Greedy (.*): Matches as much as possible
  • Lazy (.*?): Matches as little as possible

Example:

Text: "abc123def456"
Greedy (.*\d): "abc123def4"
Lazy (.*?\d): "abc1"

How do I use capture groups?

Capture groups () allow you to reference matched parts in the replacement:

  • $1, $2, $3 refer to the first, second, third groups
  • $& refers to the entire match
  • $ refers to the position before the match

Usage Questions

How do I replace only the first occurrence?

Uncheck the "Global (g)" option. This will replace only the first match instead of all matches.

How do I make the search case-insensitive?

Check the "Ignore Case (i)" option. This will match text regardless of case differences.

What does the "Multiline (m)" option do?

When enabled, ^ and $ match the beginning and end of each line, not just the beginning and end of the entire text.

How do I preview matches before replacing?

The tool automatically shows a "Match Preview" section that lists all matches found by your pattern. This helps you verify the pattern is working correctly before applying the replacement.

Can I undo a replacement?

The tool doesn't have an undo feature, but you can:

  • Use the history feature to reload previous patterns
  • Keep the original text in a separate document
  • Use the browser's back button if you haven't refreshed the page

Troubleshooting

Why is my regex pattern not working?

Common issues:

  1. Invalid syntax: Check for unescaped special characters
  2. Wrong flags: Ensure "Use Regex" is enabled
  3. Pattern too complex: Try a simpler pattern first
  4. Case sensitivity: Check the "Ignore Case" option

Why am I getting "Invalid regular expression" error?

This usually means:

  • Unescaped special characters in the pattern
  • Unbalanced parentheses or brackets
  • Invalid quantifier syntax
  • Malformed character classes

Why are no matches found?

Possible reasons:

  1. Pattern doesn't match: Test with simpler patterns first
  2. Case sensitivity: Try enabling "Ignore Case"
  3. Wrong mode: Ensure "Use Regex" is enabled for regex patterns
  4. Text encoding: Check for hidden characters or encoding issues

Why is the replacement not working as expected?

Check these:

  1. Global flag: Ensure "Global (g)" is enabled for multiple replacements
  2. Capture groups: Verify $1, $2 syntax in replacement text
  3. Special characters: Escape special characters in replacement text
  4. Preview matches: Use the preview to verify the pattern

The tool is running slowly with large text

For better performance:

  1. Process in chunks: Break large text into smaller pieces
  2. Simplify patterns: Use more specific patterns instead of .*
  3. Clear history: Remove old history entries
  4. Close other tabs: Free up browser memory

Advanced Questions

Can I use named capture groups?

Yes, JavaScript supports named capture groups:

Pattern: (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})
Replace: ${day}/${month}/${year}

How do I handle newlines in patterns?

  • Use \n for newline characters
  • Use \r\n for Windows-style line endings
  • Use \s to match any whitespace including newlines
  • Enable "Multiline (m)" for line-based anchors

Can I use lookahead and lookbehind?

Yes, the tool supports:

  • Positive lookahead: (?=pattern)
  • Negative lookahead: (?!pattern)
  • Positive lookbehind: (?<=pattern)
  • Negative lookbehind: (?<!pattern)

How do I replace text across multiple lines?

Use the dotall flag or [\s\S] instead of .:

Pattern: start[\s\S]*?end
Replace: replacement

History and Storage

How long is history saved?

History is saved in your browser's local storage and persists until you:

  • Clear your browser data
  • Manually clear the history
  • Use the tool in an incognito/private window

Can I export my history?

Currently, there's no export feature, but you can:

  • Copy patterns from the history manually
  • Take screenshots of successful patterns
  • Keep a separate document with your patterns

Is history shared between devices?

No, history is stored locally in each browser and device. It's not synchronized across devices.

Performance and Limits

What's the maximum text size I can process?

There's no hard limit, but performance may degrade with very large texts (1MB+). For best results:

  • Process large files in chunks
  • Use efficient regex patterns
  • Clear browser cache if needed

Can I process multiple files at once?

The tool processes one text at a time. For multiple files:

  • Process each file separately
  • Copy results between files
  • Use the history to reuse patterns

Does the tool work offline?

Yes, once the page is loaded, the tool works completely offline. All processing happens in your browser.

Getting Help

Where can I learn more about regular expressions?

How do I report a bug or request a feature?

You can:

  • Use the feedback form on the website
  • Contact support through the help section
  • Report issues via the project's issue tracker

Can I suggest new examples or patterns?

Yes! We welcome suggestions for:

  • New example patterns
  • Additional use cases
  • Documentation improvements
  • Feature requests

Still have questions? Try the Text Replacer tool and experiment with different patterns, or check out the Examples page for more inspiration!

Was this page helpful?