Text
Regex nahrazení
Hledejte a nahrazujte text pomocí regulárních výrazů se zachytávacími skupinami.
Loading…
O Regex Replace
Regex Replace provádí výkonné find-and-replace operations na textu pomocí JavaScript-compatible regular expressions s plnou podporou pro capture groups, named groups, lookaheads, lookbehinds a všechny standardní regex flags. Je mnohem flexibilnější než literal text search-and-replace, což vám umožňuje match a transform complex text patterns, reorder captured substrings a process entire documents v single operation. Nástroj poskytuje real-time match highlighting, takže můžete přesně vidět, co pattern matches, než se zavážete k replacement. Podporuje global (g), case-insensitive (i), multiline (m), dotAll (s) a Unicode (u) flags.
Jak Používat
Zadejte svůj source text do top input area, type a regular expression pattern do search field a provide a replacement string pomocí $1, $2 nebo named groups $<name> pro reference captured groups. Nastavte regex flags, jako je g pro global replace, i pro case-insensitive matching nebo m pro multiline anchor behavior pomocí flags checkboxes. Klikněte na Replace pro aplikaci substitution a zobrazení result. Match count je shown, takže víte, kolik substitutions bylo provedeno. Zkopírujte output z result panel.
Běžné Případy Použití
- Přeformátování date strings z MM/DD/YYYY na ISO 8601 YYYY-MM-DD format napříč celými log files nebo CSV exports
- Stripping HTML tags z scraped content při preserving the inner text každého elementu pomocí capture group replacement
- Renaming JavaScript variable names nebo function identifiers consistently napříč pasted code snippet pomocí word-boundary anchors
- Extrahování a rearranging structured data fields pomocí named capture groups pro reorder columns v delimited text
- Cleaning log file lines odstraněním ISO timestamps, log level prefixes a thread identifiers pro extrakci core message text