Re: Definitive guide for Regex

2021-10-05 Thread Karsten Hilbert
Am Thu, Sep 30, 2021 at 12:29:16PM +0100 schrieb Shaozhong SHI:

> I am trying to look for a definitive guide for Regex in Python.
> Can anyone help?

If you tell us what you tried in order to look we can
perhaps guide you on how to take a better look.

Spoonfeeding doesn't seem to be a well-liked activity,
neither here nor on the PostgreSQL lists.

Best,
Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definitive guide for Regex

2021-10-02 Thread Barry Scott



> On 1 Oct 2021, at 10:58, Shaozhong SHI  wrote:
> 
> Hi, Barry,
> 
> In cases of automating checking, validation and producing reports in the 
> context of data quality control and giving specific feedback to production 
> teams, regex is perhaps the only way.
> 
> Perhaps, we can give each element of data specifications a name, that are 
> associated with a regex value, so that we can automate checking and reporting 
> on data sets.  We can report on which row of records meet specification and 
> requirements and which one is not.  And, report on which cell needs to be 
> corrected should a row is found not meeting specification and requirements.
> 
> What do you think?

It depends a lot of the details of that you have to validate. There is not 
enough to guess at a design.
It may well be that uses regex's is a good way to do it.

Barry


> 
> Regards,
> 
> David
> 
> On Thu, 30 Sept 2021 at 22:02, Barry Scott  <mailto:ba...@barrys-emacs.org>> wrote:
> 
> 
> > On 30 Sep 2021, at 19:35, dn via Python-list  > <mailto:python-list@python.org>> wrote:
> > 
> > On 01/10/2021 06.16, Barry Scott wrote:
> >> 
> >> 
> >>> On 30 Sep 2021, at 12:29, Shaozhong SHI  >>> <mailto:shishaozh...@gmail.com>> wrote:
> >>> 
> >>> Dear All,
> >>> 
> >>> I am trying to look for a definitive guide for Regex in Python.
> >>> Can anyone help?
> >> 
> >> Have you read the python docs for the re module?
> > 
> > 
> > I learned from Jeffrey Friedl's book "Mastering Regular Expressions",
> > but that was in a land far away, last century, and under a different
> > language (and the original version - I see it's now up to its third
> > edition).
> > 
> > Despite their concise exercise of power (and the fact that in my
> > Python-life I've never been put into a corner where I absolutely must
> > use one), I'm no longer a fan...
> 
> Agreed, regex is the last tool I reach for in python code.
> I find I use split() a lot to break up strings for processing.
> But there are cases where a regex is the best tool for a particular job
> and I then use the re module. But it costs in maintainability.
> 
> I speak as the author of a regex engine and know how to write scary
> regex's when the need arises.
> 
> Barry
> 
> 
> > -- 
> > Regards,
> > =dn
> > -- 
> > https://mail.python.org/mailman/listinfo/python-list 
> > <https://mail.python.org/mailman/listinfo/python-list>
> > 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list 
> <https://mail.python.org/mailman/listinfo/python-list>

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definitive guide for Regex

2021-10-01 Thread Jach Feng
Shaozhong SHI 在 2021年9月30日 星期四下午7:29:47 [UTC+8] 的信中寫道:
> Dear All, 
> 
> I am trying to look for a definitive guide for Regex in Python. 
> Can anyone help? 
> 
> Regards, 
> 
> David
Try the rexegg.com which is a site dedicate to this subject and has many 
resources.

--Jach
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definitive guide for Regex

2021-10-01 Thread Shaozhong SHI
Hi, Barry,

In cases of automating checking, validation and producing reports in the
context of data quality control and giving specific feedback to production
teams, regex is perhaps the only way.

Perhaps, we can give each element of data specifications a name, that are
associated with a regex value, so that we can automate checking and
reporting on data sets.  We can report on which row of records meet
specification and requirements and which one is not.  And, report on which
cell needs to be corrected should a row is found not meeting specification
and requirements.

What do you think?

Regards,

David

On Thu, 30 Sept 2021 at 22:02, Barry Scott  wrote:

>
>
> > On 30 Sep 2021, at 19:35, dn via Python-list 
> wrote:
> >
> > On 01/10/2021 06.16, Barry Scott wrote:
> >>
> >>
> >>> On 30 Sep 2021, at 12:29, Shaozhong SHI 
> wrote:
> >>>
> >>> Dear All,
> >>>
> >>> I am trying to look for a definitive guide for Regex in Python.
> >>> Can anyone help?
> >>
> >> Have you read the python docs for the re module?
> >
> >
> > I learned from Jeffrey Friedl's book "Mastering Regular Expressions",
> > but that was in a land far away, last century, and under a different
> > language (and the original version - I see it's now up to its third
> > edition).
> >
> > Despite their concise exercise of power (and the fact that in my
> > Python-life I've never been put into a corner where I absolutely must
> > use one), I'm no longer a fan...
>
> Agreed, regex is the last tool I reach for in python code.
> I find I use split() a lot to break up strings for processing.
> But there are cases where a regex is the best tool for a particular job
> and I then use the re module. But it costs in maintainability.
>
> I speak as the author of a regex engine and know how to write scary
> regex's when the need arises.
>
> Barry
>
>
> > --
> > Regards,
> > =dn
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definitive guide for Regex

2021-09-30 Thread Barry Scott



> On 30 Sep 2021, at 19:35, dn via Python-list  wrote:
> 
> On 01/10/2021 06.16, Barry Scott wrote:
>> 
>> 
>>> On 30 Sep 2021, at 12:29, Shaozhong SHI  wrote:
>>> 
>>> Dear All,
>>> 
>>> I am trying to look for a definitive guide for Regex in Python.
>>> Can anyone help?
>> 
>> Have you read the python docs for the re module?
> 
> 
> I learned from Jeffrey Friedl's book "Mastering Regular Expressions",
> but that was in a land far away, last century, and under a different
> language (and the original version - I see it's now up to its third
> edition).
> 
> Despite their concise exercise of power (and the fact that in my
> Python-life I've never been put into a corner where I absolutely must
> use one), I'm no longer a fan...

Agreed, regex is the last tool I reach for in python code.
I find I use split() a lot to break up strings for processing.
But there are cases where a regex is the best tool for a particular job
and I then use the re module. But it costs in maintainability.

I speak as the author of a regex engine and know how to write scary
regex's when the need arises.

Barry


> -- 
> Regards,
> =dn
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definitive guide for Regex

2021-09-30 Thread dn via Python-list
On 01/10/2021 06.16, Barry Scott wrote:
> 
> 
>> On 30 Sep 2021, at 12:29, Shaozhong SHI  wrote:
>>
>> Dear All,
>>
>> I am trying to look for a definitive guide for Regex in Python.
>> Can anyone help?
> 
> Have you read the python docs for the re module?


I learned from Jeffrey Friedl's book "Mastering Regular Expressions",
but that was in a land far away, last century, and under a different
language (and the original version - I see it's now up to its third
edition).

Despite their concise exercise of power (and the fact that in my
Python-life I've never been put into a corner where I absolutely must
use one), I'm no longer a fan...
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definitive guide for Regex

2021-09-30 Thread Barry Scott



> On 30 Sep 2021, at 12:29, Shaozhong SHI  wrote:
> 
> Dear All,
> 
> I am trying to look for a definitive guide for Regex in Python.
> Can anyone help?

Have you read the python docs for the re module?

Barry

> 
> Regards,
> 
> David
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Definitive guide for Regex

2021-09-30 Thread Shaozhong SHI
Dear All,

I am trying to look for a definitive guide for Regex in Python.
Can anyone help?

Regards,

David
-- 
https://mail.python.org/mailman/listinfo/python-list