{"category":"text","endpoint":"https://setget.net/v1/tools/regex-replace","examples":[{"input":{"pattern":"(\\w+)@(\\w+)\\.com","replacement":"\\2: \\1","text":"sam@example.com"},"output":{"replacements":1,"text":"example: sam"}},{"input":{"pattern":"\\s+","replacement":" ","text":"a   b \n c"},"output":{"replacements":2,"text":"a b c"},"title":"Collapse whitespace"}],"input_schema":{"additionalProperties":false,"properties":{"count":{"default":0,"description":"Replace at most this many matches. 0 replaces all.","minimum":0,"type":"integer"},"flags":{"default":"","description":"Letters that switch options on: i (ignore case), m (^ and $ match at each line), s (dot matches line breaks), x (allow spaces and comments).","maxLength":8,"type":"string"},"pattern":{"description":"The regular expression (Python syntax).","examples":["(\\w+)@(\\w+)\\.com"],"maxLength":2000,"type":"string"},"replacement":{"default":"","description":"Replacement text. \\1 or \\g<name> inserts a group, \\g<0> the whole match.","examples":["\\2: \\1"],"maxLength":10000,"type":"string"},"text":{"description":"The text to change.","examples":["sam@example.com"],"type":"string"}},"required":["pattern","text"],"type":"object"},"keywords":["regex replace","regular expression","search and replace","substitute","sed","backreference","regex substitution"],"related":["regex-test","find-replace","regex-extract"],"slug":"regex-replace","summary":"Replace every match of a regular expression, with backreferences such as \\1 in the replacement.","tier":"inline","title":"Regex replace","url":"https://setget.net/tools/regex-replace"}
