Hello,
The following line of code works:
https://github.com/LLyaudet/DevOrSysAdminScripts/blob/18907db862f38aa3e499ef88b5e2e1298bbd28e2/git_helpers/git_checks.libr.sh#L85
if grep ' = .*,\s*$' /tmp/DOSAS_django_git_check2.temp;
I was surprised to notice this when rereading a listing of my source code.
Basic Regular Expressions (BRE) are the default according to `man grep`.
And BREs use POSIX character classes instead of Perl character classes.
Sample test:
$ echo "a = 123," > bla.py
$ grep ' = .*,\s*$' bla.py
a = 123,
$ echo "a = 123, " >> bla.py
$ grep ' = .*,\s*$' bla.py
a = 123,
a = 123,
$ echo "a = 123,111" >> bla.py
$ grep ' = .*,\s*$' bla.py
a = 123,
a = 123,
$
Why is that regular expression working without adding -P or
--perl-regexp option?
Thanks in advance, best regards,
Laurent Lyaudet