How do you handle sed?

How do you handle sed?
Answer
Sed uses basic regular expressions.
…
In a nutshell, for sed ‘s/…/…/’ :
  1. Write the regex between single quotes.
  2. Use ”’ to end up with a single quote in the regex.
  3. Put a backslash before $. …
  4. Inside a bracket expression, for – to be treated literally, make sure it is first or last ( [abc-] or [-abc] , not [a-bc] ).
 

Tìm kiếm

Back
Top