Al Sweigart   Yes, It's Time to Learn Regular Expressions   PyCon 2017

Al Sweigart Yes, It's Time to Learn Regular Expressions PyCon 2017

PyCon 2017

7 лет назад

39,429 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@iktunutki
@iktunutki - 22.05.2017 08:24

About raw strings: it is not true that you'd have to escape \d.
>>> re.search('\d', '1')
<_sre.SRE_Match object; span=(0, 1), match='1'>
However, you'd need a raw to avoid escaping group references like \1
>>> re.search('(\d)\1', '11') # tries to match character \u0001
>>> re.search(r'(\d)\1', '11')
<_sre.SRE_Match object; span=(0, 2), match='11'>
>>> re.search('(\d)\\1', '11')
<_sre.SRE_Match object; span=(0, 2), match='11'>

There is a project that does the opposite of what you mentioned: given a list of strings, they produce a regex that matches them all (and isn't just a big OR of them all). Can't remember the name, though.

Ответить
@NoBSFX
@NoBSFX - 27.05.2017 18:20

nice dude !! , got me into programming and python .. thanks to " how to automate the boring stuff"

Ответить
@RickyTeachey
@RickyTeachey - 14.06.2017 21:58

Regex has always scared the stink out of me ever since I saw my first regex string years and years ago. Thanks for holding the listener's hand through this.

Ответить
@byomkesh99
@byomkesh99 - 25.07.2017 14:21

Thank you very much Bro. I learned RegEX from you.

Ответить
@johncherry108
@johncherry108 - 07.08.2017 16:01

Shouldn't we be careful to distinguish between slashes and backslashes?

Ответить
@coffeebutch
@coffeebutch - 25.09.2017 17:25

i've been learning from this book and i was being ok with the fundamentals but Regex literally got me stuck and frustrated big times. kinda boring and unmotivated to learn it but indeed this is what's really useful in real life..

Ответить
@pradagruza1301
@pradagruza1301 - 02.10.2017 19:37

Microsoft has a proprietary tool called RobustFill that can learn regexes from examples. It is better than all such tools before it. It is not free or open-source. There is however a technical publication associated with it on Arxiv, and it appears to be reproducible.

Ответить
@mrfran1
@mrfran1 - 25.10.2017 00:56

The “live demo” god.

Ответить
@thenomadcoder
@thenomadcoder - 11.01.2018 05:23

at last a way to understand the damned htaccess file!!! thanks!!

Ответить
@seanspicer516
@seanspicer516 - 23.12.2018 23:01

but idunno if i can handle another problem...

Ответить
@AlqGo
@AlqGo - 30.12.2018 05:58

Regex is a pain not because it's difficult to learn (because it's not and it's quite easy actually), but because different languages have some slight variations in the regex syntax rules.

Why do programmers like to add to the messiness of the whole world of regex flavors is really a mystery.

Ответить
@raghavatreya4533
@raghavatreya4533 - 22.05.2019 14:23

In video he says that
I cannot write a regex to find out the other regex is valid or not?

Ответить
@juliejones8785
@juliejones8785 - 09.12.2019 02:41

Not bad, but some mistakes. Special characters lose their special meaning inside sets. For example, [(+*)] will match any of the literal characters '(', '+', '*', or ')'

Ответить
@susmitvengurlekar
@susmitvengurlekar - 17.07.2020 20:37

Watching this video for the 15th or 20th time. YOU Sir, your way of giving talk, got me started on teaching python. Thank you.

Ответить
@disk38
@disk38 - 31.07.2020 02:24

great

Ответить
@superjerkk
@superjerkk - 14.08.2021 04:59

It's kind of bullshit that the letter Y isn't a vowel.

Like common, how is Y not a vowel.

Ответить
@malayagr
@malayagr - 24.08.2021 23:56

Idea for that project:
Take the regex and build a DFA. Of course, you'd have to first make an NFA and then convert it to a DFA. A DFA is a graph with a single start and potentially multiple but at least one final state. So, you can start at the start state and traverse the edges using a path finding algorithm between two nodes of a graph until you get to the some final state, outputting the characters that label the edges along the way. This will give you a string accepted by the regex. It won't be fast but I'm pretty sure it will work.

Ответить
@paulallen1597
@paulallen1597 - 13.08.2022 03:12

Al Sweigart always has great talks. Thanks Al!!!!!

Ответить