Update regex

This commit is contained in:
2024-12-04 22:15:25 +08:00
parent 486afb7a1b
commit c1b917059b
2 changed files with 3 additions and 4 deletions

View File

@ -3,7 +3,7 @@
# Filter out do(), don't(), and mul()
# then strip out tails to get do and don
# strip out mul() to get numbers
grep -Po 'do\(\)|don(.)?t\(\)|mul\([0-9]+,[0-9]+\)' input |
grep -Po 'do\(\)|don.t\(\)|mul\([0-9]+,[0-9]+\)' input |
grep -Po 'don|do|mul\([0-9]+,[0-9]+\)' |
sed -E 's/^mul\(([0-9]+),([0-9]+)\)/\1 \2/g' |
awk '

View File

@ -4,7 +4,6 @@ paste -s -d '' input.txt |
perl -lne '
print "$1$4$2$3"
while
/(?<=(.).)(?<=(.).{138})A(?=.{138}(.))(?=.(.))/g
/(?<=(.).(.).{138})A(?=.{138}(.).(.))/g
' |
grep -Eo '(SM|MS){2}' |
wc -l
grep -Ec '(SM|MS){2}'