/b/c++
matches / - b - / - c (one or more occurrences) - + (this one seems to be ignored)
So:
% echo a/b/c+ | awk -F'/b/c++' '{print $1, $2}'
a +
% echo a/b/cccc+ | awk -F'/b/c++' '{print $1, $2}'
a +
/b/c++$
matches / - b - / - c (one or more occurrences) - + (ignored)
at the end of the string ($):
These two should be clear:
% echo a/b/c++ |
awk -F'/b/c++$' '{
print "NF:", NF
print "$1:", $1
print "$2:", $2
}'
NF: 1
$1: a/b/c++
$2:
% echo a/b/c++ |
awk -F'/b/c++' '{
print "NF:", NF
print "$1:", $1
print "$2:", $2
}'
NF: 2
$1: a
$2: ++
Here the pattern (FS) is not found:
% echo a/b/c++ |
awk -F'/b/c++$' '{
print "NF:", NF
print "$1:", $1
print "$2:", $2
}'
NF: 1
$1: a/b/c++
$2:
I suppose that the behaviour is unspecified for more than one consecutive quantifiers (+ signs), it siply ignores the second + sign:
% echo a/b/c |
awk -F'/b/c++$' '{
print "NF:", NF
print "$1:", $1
print "$2:", $2
}'
NF: 2
$1: a
$2:
Here only the last a/b/c[c..]
matches, because it's at the end of the record:
% echo a/b/ca/b/ccc |
awk -F'/b/c++$' '{
print "NF:", NF
print "$1:", $1
print "$2:", $2
}'
NF: 2
$1: a/b/ca
$2:
This may be implementation specific (I've used GNU awk 4.0 and nawk version 20070501).