Re: regex failing

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Zahir Lalani <ZahirLalani(at)oliver(dot)agency>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: regex failing
Date: 2023-06-27 19:15:38
Message-ID: CAKFQuwZoBj6uD1Kmu-QjRsDj4CZYKWhuvaAJrBFcNB9N1aiCjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 27, 2023 at 11:59 AM Zahir Lalani <ZahirLalani(at)oliver(dot)agency>
wrote:

> Hi All
>
>
>
> Got a weird one. I am using the regex below to case match numeric only
> values.
>
>
>
> '^([0-9]+[.]?[0-9]*)$'
>
>
>
> This works well by and large but not for a value like “1234:567”. This
> seems to match positive and then fails due to not being an actual number in
> the subsequent cast.
>
>
>
Works (returns false) here:
select '1234:567' ~ '^([0-9]+[.]?[0-9]*)$';

https://mail.google.com/mail/u/0/?tab=mm&zx=y3hfqt48pyg7#all/FMfcgzGsnLNNXcRVCVNpjQhGknMSVLKn

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Baldwin 2023-06-27 19:17:30 Re: regex failing
Previous Message Adrian Klaver 2023-06-27 19:10:30 Re: typical active table count?