1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-03 04:03:24 -07:00
rc/sh/meow.sh/splittags.awk

14 lines
254 B
Awk

{
str=$0
topen="<"tag">"
tclose="</"tag">"
len=length(tag)
for (;;) {
begin=index(str, topen)
end=index(str,tclose)
if (!(begin || end)) break
print substr(str, begin+len+2, end-begin-len-2)
str=substr(str, end+len+3)
}
}