sam_regexp__doesnt_match_end_of_line_when_there_is_no_newline

Sat, 19 Sep 2015 13:19:54 EDT
tereniaopensim@[REDACTED]

test text in /dev/snarf: {{{ grammatikidis.punked.us eekee.mooo.com ethan.uk.to testing.ethan.uk.to terenia.mooo.com }}}

test: {{{ echo ‘,x/^/i/./ ,x/\n/c/ / ,x/ +$/c/\n/ w ’ | sam -d /dev/snarf }}}

the last regexp, / +$/, doesn’t match because all the newlines have been deleted.

i confirmed it’s the $ which doesn’t match by eliminating the other parts; it matched only when i added a space to the end of terenia.mooo.com in the source and changed the regexp to just two spaces, no $.

acme doesn’t have this bug, but produces ‘warning: changes out of sequence’. this warning appears to be nonsense. if it followed the expressions according to the syntax, how could it make the changes out of order? obviously acme can’t be scripted in the same way. i tested it by selecting all within the quotes in the test above, and applying it to Edit on a window containing the test text.