Subject: Re: [ast-users] Difference between [[ == ]] and [[ =~ ]]?
--------

> As followup to a recent thread: What is the difference between [[ ==
> ]] and [[ =~ ]]?
> 

The right hand side of == is either a string or a shell pattern.
The right hand side of =~ is and extended regular expression.

Since shell patterns have all the functionality of ere's, this
does not add any new functionality but does allow users who are
more familiar with ere syntax to use that instead.

In fact, the shell pattern ~(E)(ere) is equivalent to ere, so that
=~ can also be written as
        [[ string == ~(E)(ere) ]]


David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to