Re: Regex for (A) and (B) to find in Bus Stop (A) or (B)

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Regex for (A) and (B) to find in Bus Stop (A) or (B)
Date: 2021-11-03 20:01:38
Message-ID: CAKFQuwYYCbV2V+WJWWEdLAOSv8=FsmrQeqf1=iDNdxFehEEWTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, November 3, 2021, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Wednesday, November 3, 2021, Shaozhong SHI <shishaozhong(at)gmail(dot)com>
> wrote:
>
>> What is the regex for (A) and (B) to find in Bus Stop (A) or (B)?
>>
>
> Not tested…
>
> ^Bus\sStop\s\((\w)\)\sor\((\w)\)$
>
> The \s can just written as a space though the above seems clearer in email
> (though it allows for non-space whitespace too)
>

Sorry, the actual matcher probably should be something like:
[^)]+

So it matches everything except the closing paren. If the value can
contain a paren its more complicated and I’d need to test and check to
figure it out.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bryn Llewellyn 2021-11-03 20:39:00 Re: to_date() and to_timestamp() with negative years
Previous Message David G. Johnston 2021-11-03 19:55:45 Re: Regex for (A) and (B) to find in Bus Stop (A) or (B)