Hi again,

Oh, right, that makes sense. And like I feared, I was indeed wasting your time.

Thanks for the info, sorry about the time.

Morten

Andreas Schwab wrote:
Morten Lauritsen Khodabocus <mlauri...@gmail.com> writes:

Two regular expressions should match the same thing, but for some reason
do not:
[[ '/home/' =~ [^/]+ ]]; echo ${bash_remat...@]}
and
[[ '/home/' =~ [^/]* ]]; echo ${bash_remat...@]}
the first matches 'home', the second matches nothing. The only difference
is * vs. + AFAICT, both expressions should match 'home'.

"[^/]*" matches the null string at the start of '/home/', and there is
no reason for the matcher to try another match.

Andreas.




Reply via email to