Sed Command Validator
Checks sed command syntax and explains each part in plain English.
Build sed commands for find and replace, deleting lines, printing ranges, and inserting text, without memorising the syntax. Preview the result on sample text before you run it.
A sed command is sed [options] 'script' file. The script is an optional address (which lines) followed by a command (what to do).
s/find/replace/flags. g replaces every match on a line, I ignores case (GNU sed), and a number replaces only that occurrence./, the generator switches to another delimiter such as | or #, so paths don't need escaping.. * [ ] ^ $ \) are escaped, and & is escaped in the replacement.5 is line 5, 10,20 is a range, $ is the last line, and /error/ is every line that matches.'\''.http:// with https:// in links.txt: sed 's|http://|https://|g' links.txtsed '/^$/d' file.txtsed -n '10,20p' file.txtDEBUG and save the file: sed -i '/DEBUG/d' app.log on Linux, or sed -i '' '/DEBUG/d' app.log on macOS.[mysqld]: sed '/\[mysqld\]/a max_connections=500' my.cnfh, G, x) are not built here. Use the Validate tab to check them.a, i, and c with text on the same line are GNU sed syntax. On macOS, install GNU sed (gsed) or add a backslash and a line break.BSD sed on macOS needs a backup suffix after -i. Use sed -i '' 's/a/b/' file for no backup. The generator writes this form when you choose macOS.
Use a different delimiter: s|/usr/local|/opt|g. The generator does this automatically.
Without g, sed replaces only the first match on each line. With it, every match on the line is replaced.
No. The preview runs in your browser.
Often used together with the Sed Command Generator.
Checks sed command syntax and explains each part in plain English.
Highlights regex matches live, lists capture groups and offsets, and previews replacements.
Compares two texts or code files and highlights added, removed, and changed lines.