تخطى إلى المحتوى الرئيسي

Find Replace

Our find-and-replace tool goes beyond simple text substitution: it supports regular expressions, case-sensitive/insensitive matching, whole-word matching, and batch multi-pattern replacement. It processes large text blocks instantly in-browser and shows a change summary — useful for bulk text cleaning, data transformation, and template variable substitution.

الأصلي

النتيجة

شارك هذه الأداة
Text Tools

حول Find & Replace Tool

Our find-and-replace tool goes beyond simple text substitution: it supports regular expressions, case-sensitive/insensitive matching, whole-word matching, and batch multi-pattern replacement. It processes large text blocks instantly in-browser and shows a change summary — useful for bulk text cleaning, data transformation, and template variable substitution.

كيفية الاستخدام

  1. Enter the search pattern (plain text or regex) and replacement string.
  2. Paste your text in the input area.
  3. Toggle options: case-sensitive, whole word, regex mode.
  4. Add multiple find/replace pairs for batch substitution.
  5. See a summary: how many matches were found and replaced.

الصيغة والمنهجية

Plain: String.prototype.replaceAll(). Regex: String.replace(new RegExp(pattern, flags), replacement). Backreferences in replacement: $1, $2 reference captured groups. Named groups: $<name>. Special patterns: $& (whole match), $' (after match), $` (before match). Case manipulation in replacement is not supported in JS natively (use callback function).

حالات الاستخدام الشائعة

  • Data cleaning: replacing inconsistent date formats or abbreviations
  • Template processing: substituting {{variable}} placeholders with values
  • Code refactoring without an IDE: renaming a variable across a snippet
  • CSV cleanup: replacing commas inside fields, fixing encoding issues
  • Bulk URL updating: changing domain names across many links

الأسئلة الشائعة

In regex mode: use \n to match Unix line endings (LF), \r\n for Windows (CRLF), or \r for old Mac (CR). Enable the "multiline" flag so ^ and $ match line boundaries. To normalize all line endings: replace \r\n|\r|\n with \n. Many tools have a dedicated "normalize line endings" option which is safer than manual regex.
Yes, in regex mode. Define a group with parentheses in the search: (\w+)@(\w+). Reference it in replacement: $1 at $2. Example: finding dates in MM/DD/YYYY format "(\d{2})/(\d{2})/(\d{4})" and replacing with "$3-$1-$2" converts to ISO format YYYY-MM-DD. Named groups: (?<year>\d{4}) and replacement $<year>.

أدوات ذات صلة

كل الأدوات →

دمج هذه الأداة في موقعك

مجاني للاستخدام الشخصي والتجاري. فقط انسخ الكود أدناه.