Browse Source

Added sed example

George Jones 1 year ago
parent
commit
9930950d9a
1 changed files with 11 additions and 0 deletions
  1. 11 0
      home/public/snippits/sed/sed-example.org

+ 11 - 0
home/public/snippits/sed/sed-example.org

@@ -0,0 +1,11 @@
+#+begin_example
+echo 'abc :results output :eval no' | sed -E 's#.*(results [[:alnum:]]{1,}).*#\1#'
+#+end_example
+
+This demonstrates the following uses of GNU sed:
+
+- Extended regexps :: =-E=
+- Substitution :: =s#OLD#NEW#=
+- Character classes :: =[[:alnum:]]=
+- "bounds" :: ={1,0}= (could be =+=)
+- replacement :: =s#(FOO)#\1#=