On 03/24/2017 07:45 PM, Brad Gilbert wrote:
All of these should work

    if $Terminal ~~ /xterm/ | /linux/ {}
    if $Terminal ~~ /xterm | linux/ {}
    if $Terminal ~~ /xterm || linux/ {}

Note that | in a regex tries both sides as if in parallel, and goes
for the longest,

Hi Brad,

What do you mean by longest?

while || tries the left side first, then the right side.
Basically use | in regexes unless you need ||.

Would this be the logical AND equivalent?

    if $Terminal ~~ /xterm && linux/ {}

Thank you!

-T

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to