Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sed: Can my pattern contain an "is not" character? How do I say "is not X"?

Tags:

regex

sed

How do I say "is not" a certain character in sed?

like image 790
KRB Avatar asked Sep 22 '11 19:09

KRB


People also ask

Can you use regex in sed?

The sed command has longlist of supported operations that can be performed to ease the process of editing text files. It allows the users to apply the expressions that are usually used in programming languages; one of the core supported expressions is Regular Expression (regex).

What is expression in sed?

5.1 Overview of regular expression in sed A regular expression is a pattern that is matched against a subject string from left to right. Most characters are ordinary: they stand for themselves in a pattern, and match the corresponding characters. Regular expressions in sed are specified between two slashes.

What is r option in sed command?

r is used to read a file and append it at the current point. The point in your example is the address /EOF/ which means this script will find the line containing EOF and then append the file specified by $thingToAdd after that point. Then it will process the rest of the file.


1 Answers

[^x] 

This is a character class that accepts any character except x.

like image 76
Tom Zych Avatar answered Oct 08 '22 22:10

Tom Zych