v4hn/snotes — pull request #8 by kmsiwiec (2013-04-14 01:35:44+00:00)
Title: use grep -E for SNOTES_DONTCLEAN_REGEXP

the latest snotes pull misbehaves here on obsd-5.2-release/amd64. commit 663e719b03c055391fc09b857da17e32f0502f77 introduced SNOTES_DONTCLEAN_REGEXP with extended regular expressions, which expr(1) does not understand:

> The \`:' operator matches expr1 against expr2, which must be a basic regular expression. The regular expression is anchored to the beginning of the string with an implicit \`^'.

in addition, leaving SNOTES_DONTCLEAN_REGEXP undefined in the snotes config file breaks expr(1):

```
$ snotes_file="test.txt"
$ unset SNOTES_DONTCLEAN_REGEXP
$ test $(expr "$snotes_file" : "$SNOTES_DONTCLEAN_REGEXP") -eq 0
expr: empty (sub)expression
/bin/ksh: test: 0: unexpected operator/operand
```

the egrep branch attempts to fix this by using egrep(1) and providing a default SNOTES_DONTCLEAN_REGEXP value.