September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
26
Task/Run-length-encoding/Sed/run-length-encoding-1.sed
Normal file
26
Task/Run-length-encoding/Sed/run-length-encoding-1.sed
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/^$/ b
|
||||
:start
|
||||
/^[0-9]/ b
|
||||
s/^/1/
|
||||
:loop
|
||||
h
|
||||
/^9+([^0-9])\1+/ {
|
||||
s/^(9+).*/0\1/
|
||||
y/09/10/
|
||||
G
|
||||
s/^(.+)\n[0-9]+.(.*)/\1\2/
|
||||
b loop }
|
||||
/^[0-9]*[0-8]([^0-9])\1+/ {
|
||||
s/^[0-9]*([0-8]).*/\1/
|
||||
y/012345678/123456789/
|
||||
G
|
||||
s/^(.)\n([0-9]*)[0-8].(.*)/\2\1\3/
|
||||
b loop }
|
||||
/^[0-9]+9+([^0-9])\1+/ {
|
||||
s/^[0-9]*([0-8]9+).*/\1/
|
||||
y/0123456789/1234567890/
|
||||
G
|
||||
s/^(.+)\n([0-9]*)[0-8]9+.(.*)/\2\1\3/
|
||||
b loop }
|
||||
s/^([0-9]+.)(.*)/\2\1/
|
||||
b start
|
||||
Loading…
Add table
Add a link
Reference in a new issue