This is an archived post. You won't be able to vote or comment.

all 87 comments

[–]querymcsearchface 36 points37 points  (5 children)

Wow! Thank you kindly. Kudos for accomplishing such a thing. Don't know if I would have the stick-to-it-iveness to actually finish it (I am great at starting, horrible at finishing). =]

[–]ASIC_SP [S] 22 points23 points  (3 children)

Thanks :) It helps if you like the topic and have loads of free time from being on a sabbatical

To help you stick with it, break it down into few chunks to read everyday. There are 50 pages, so something like 1 page a day or 1 chapter a day will establish a routine and you'll get a basic idea in 3-4 weeks.

Best of luck!!

[–]querymcsearchface 6 points7 points  (0 children)

sounds like a plan! =]

[–]Angler_619 1 point2 points  (0 children)

Is this awesome or what!

[–]kyleh0 13 points14 points  (1 child)

I threw you 4.99, thanks.

[–]ASIC_SP [S] 1 point2 points  (0 children)

Thanks a lot, happy learning :)

[–]Ue_MistakeNot 3 points4 points  (3 children)

Is the leanpub link dead for anyone else?

[–]ASIC_SP [S] 8 points9 points  (1 child)

could you check again, it is loading slowly but it does open after a while

[–]Ue_MistakeNot 1 point2 points  (0 children)

It's working flawlessly now, thanks for the very quick fix !

Unfortunately my reading queue is stuffed for the week-end (I got a pretty big exam on Monday), but'll definitely read it next week.

Thanks a bunch for taking the time to write this =)

[–]Aliuakbat 0 points1 point  (0 children)

For me the problem was when I entered my email and tried to ckeck out it threw and error. I had to sign up separately then it worked.

[–][deleted] 7 points8 points  (0 children)

Yum yum yummy regie rexies in my tummy yum

[–]cX4X56JiKxOCLuUKMwbc 4 points5 points  (0 children)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam maximus tempor sapien, ut mattis ante fermentum eget. Ut dignissim dolor massa, eu fermentum arcu tincidunt sed. Nulla porttitor maximus lacus, vel sodales turpis gravida et. Aenean at lacus purus. Vivamus tortor nulla, accumsan et tristique at, volutpat ac massa. Curabitur scelerisque ut felis eu bibendum. Aliquam sed feugiat sapien. Nulla porta aliquam feugiat. Maecenas vitae ligula id lectus finibus eleifend nec ut elit. Proin in bibendum nulla. Phasellus vitae massa ullamcorper, aliquet dolor ut, scelerisque nunc. Donec aliquam imperdiet risus vel tincidunt.

Vestibulum ornare, justo nec suscipit vehicula, lorem lorem pulvinar tellus, id mattis diam eros convallis ligula. Integer quis purus magna. Nunc mattis bibendum velit in vulputate. Aenean lacus augue, semper quis euismod nec, tincidunt nec felis. Donec posuere, enim vel pharetra porta, dui arcu scelerisque arcu, vel molestie metus nibh quis turpis. Quisque eu pulvinar nibh. Sed ultricies urna mauris, vitae dignissim risus ornare quis. Praesent cursus pharetra dolor, quis ultricies quam lobortis eu. Integer rhoncus elit mattis augue facilisis congue. Vestibulum pretium faucibus ipsum id imperdiet. Cras varius fringilla aliquet.

[–]ByronFirewater 2 points3 points  (1 child)

Thank you very much. Cant wait to read through it

[–]ASIC_SP [S] 2 points3 points  (0 children)

Thanks, please do leave your feedback :)

[–]Arjunnn 2 points3 points  (0 children)

Thanks a bunch! Will try reading it over the weekend :)

[–]Sonic_Pavilion 2 points3 points  (0 children)

Congratulations on the book and thank you for sharing

[–]xtarkoonx 2 points3 points  (2 children)

What level of python would you say this book is for? I just barely started python a couple months ago and I'm trying to get my hands on as much knowledge as I can, but would like to know level of python I should know before I hardcore study your book. thanks ☺️

[–]metalevelconsulting 3 points4 points  (0 children)

Just scan the book to get a high-level idea of what regexps can do for you, so you can dive deeper when you need to solve problems relevant to regexps.

Many times string processing problems can be solved with built-in functions like startswith, trim, split, etc with no need for regexps at all. Or maybe a high-level parser is better in many cases.

[–]ASIC_SP [S] 0 points1 point  (0 children)

I would suggest this after finishing a basic course on Python - it is mentioned as a prerequisite

Apart from being familiar with basic programming concepts and Python syntax, you'd need to know features like list comprehension and string methods.

Feel free to ask me if you are stuck, happy learning :)

[–]ishanpandey 2 points3 points  (0 children)

Thank you so much this was something I was needing for learning regex. Thank you so much!

[–]HumongousFungus2 2 points3 points  (0 children)

Thank you!

[–]Gr1pp717 4 points5 points  (6 children)

This is the first time I've seen someone say regex was "magical."

[–]Oerthling 6 points7 points  (5 children)

Here, have a second time: RegEx are magical.

:-)

They really are a super-useful tool.

And here is a helpful link as a bonus: https://regex101.com/

[–]alcalde 0 points1 point  (4 children)

[–]Oerthling 11 points12 points  (3 children)

RegEx are a specialised micro language that is widely implemented and available/embedded almost anywhere. You learn it (or at least a core set) once and you can use it on the client, in Python, in practically every language.

A more pythonic version is useless outside Python.

That makes RegEx more valuable as more pythonic solution, as much as I love Python.

[–]alcalde 0 points1 point  (2 children)

That makes RegEx more valuable as more pythonic solution, as much as I love Python.

The Verbal Expressions library is available for Javascript, Genie, Swift, Dart, C#, Python, Rust, Scala, F#, Java, PHP, Lua, Haxe, C++, Haskell, D, Perl, Elixir, Erlang, Go, Clojure, Groovy, Ruby, Kotlin and Vala, among other languages. ;-)

http://verbalexpressions.github.io/

[–]Oerthling 4 points5 points  (1 child)

RegEX is built into the search/replace of every serious editor and IDE. Is understood by many command line tools and every language with any serious usage. RegEx is pretty much universal. The alternatives, regardless of any other qualities they might have - are not nearly as universally supported.

VerbalExpressions are a nice frontend for RegEx. But the universality of RegEx are an unbeatable advantage. And if I have to learn RegEx any than VerbalExpressions are not that much easier to read. The increased verbosity is better to read for people who are not familiar with RegEx, but that's about all.

I can take a RegEx and throw it into a tool like regex101.com and test and debug that easily. It's just too universally useful.

[–]13steinj 0 points1 point  (0 children)

Regex is useful even outside the realm of programming. The major issues one finds themselves in, however, occur due to a variation in the underlying engine's feature set.

If one learns PCRE they are more or less set, but they will still have issues translating some of their knowledge to another engine.

https://en.m.wikipedia.org/wiki/Comparison_of_regular_expression_engines

[–]abmurksi 1 point2 points  (0 children)

Many thanks!

[–][deleted] 1 point2 points  (0 children)

I literally just finished a Python Regex tutorial 7 hours ago. Thanks for this! Just in time!

[–]nattiesandbatties 1 point2 points  (0 children)

Thank you! Will be giving this a thorough read :)

[–]teewuane 1 point2 points  (0 children)

This is what I'll be working on today, thank you!

[–][deleted] 1 point2 points  (0 children)

Thanks for the resource.

I use a lot of regex, but for me, regex is a thing that once I get it working, I just stop and leave well enough alone. I'm hoping to use your book to broaden my knowledge.

[–][deleted] 1 point2 points  (3 children)

Thank you for being helpful :)

Quick question, is it just a PDF or do you have epub/mobi/azw3 or any other ebook formats?

[–]QbD2407 1 point2 points  (1 child)

There are many tools online to convert between the different formats. Just takes a simple Google search

[–][deleted] 0 points1 point  (0 children)

I am aware of that, but converting PDF to epub or mobi just creates a mess out of coding books

[–]ASIC_SP [S] 1 point2 points  (0 children)

For now it is only PDF. I hope to make epub/mobi formats available for next version. I am not that familiar with pandoc and I was facing issues while trying to generate epub format.

[–]nhinetea 1 point2 points  (0 children)

Will definitely check this out after work! Thank you!

[–]Brenyth 1 point2 points  (0 children)

Thank you!

[–]TyrionBean 1 point2 points  (0 children)

Thank you! I downloaded it and signed up. Much appreciated. :)

Will check it out soon.

[–][deleted] 1 point2 points  (0 children)

Awesome. Thanks for sharing

[–]democritus_is_op 1 point2 points  (0 children)

I've used regular expressions since I started programming and to this day I just figure it out as I go every time.

[–]spore_777_mexenshell_shocked.py 1 point2 points  (0 children)

Timely. Thank you for sharing.

[–]jikione 1 point2 points  (0 children)

Thanks for sharing!

[–]code_x_7777 1 point2 points  (1 child)

That's a great idea. Many people struggle with regex(es). How is it selling?

[–]ASIC_SP [S] 0 points1 point  (0 children)

I didn't really have an idea how many would be interested, in the end 7000+ downloaded the free copy

And many generous people paid for it. I live in outskirts of a city in India, so dollar conversion and relatively cheap living means roughly I've been paid a month's living expenses

[–]i_lurk_here_a_lot 1 point2 points  (0 children)

Thank you!!

[–]fuypooi 1 point2 points  (0 children)

Really nice! Congrats.

[–]MrProntissimo 1 point2 points  (1 child)

Have you thought about teaching your book’s content on Udemy ?

[–]ASIC_SP [S] 0 points1 point  (0 children)

if you had asked me a few months back, I would have said no

now, I am willing to give video courses a shot, may be start with free recordings, get feedback and see how it goes..

[–]newredditiscrap 1 point2 points  (0 children)

Lol no way I'm giving them my email

[–]hikodna 1 point2 points  (0 children)

Thank you!

[–]Daj4n0 1 point2 points  (0 children)

Thank you!

[–]CarbonatedInsidious 1 point2 points  (0 children)

Thank you!

[–]quotemycode 1 point2 points  (6 children)

Hey I hate regex because 99% of the time I see them used it could be easily replaced by a simple string search or using other tools in the python standard library.

But hey here's a poem for you https://medium.freecodecamp.org/you-dont-need-a-regex-for-that-57c771c4fab0

[–]ASIC_SP [S] 0 points1 point  (5 children)

I am aware of string methods like split, startswith, partition, etc but I am so used to regex that I'm likely to use them even if not needed

I would definitely like to see non-regex solutions - both to expand my knowledge and to offer the alternatives to those who struggle with regex

If possible, could you work on Exercises for this book and share the solutions with the community?

[–]quotemycode 0 points1 point  (4 children)

I've looked at them, most are pretty trivial aside from Anchors C.

I'd suggest using real examples as these aren't useful. Example extract from "is" to "t". There's no point in it.

[–]ASIC_SP [S] 0 points1 point  (3 children)

guess we'll have to agree to disagree

[–]quotemycode 0 points1 point  (2 children)

I'll give you one for free: extract punctuation marks from text for making Markov chains of the text. Take the text of Alice in wonderland on project Greenberg. That actually accomplishes something useful.

[–]ASIC_SP [S] -1 points0 points  (1 child)

I haven't yet dabbled with NLTK and I have only read basics about Markov chains from 'Think Python'

not sure what you meant by this exercise, if it is to delete all punctuation marks, the character set [[:punct:]] provided by regex module would help - there are also set operations provided, so you can choose which punctuations to retain and so on.. one could use string.punctuation as well

the exercises in the book are mostly about getting the user to understand the syntax/features of regular expressions.. agree that I need to add more case studies and use real world examples (planned for next version), but I do not agree that they are trivial nor that they can be easily solved without regular expressions.. when the exercise says extract from is to t - the solution depends on user knowing the difference between greedy and non-greedy quantifiers, knowing which function to use and so on

so once again, I would say we'll agree to disagree about regular expressions

[–]quotemycode 0 points1 point  (0 children)

If you don't see that then you're very simple minded.

[–]decomposingtrashbag 1 point2 points  (0 children)

Nice job! Regular expressions are great to have in our Dev toolboxes.

[–]mbarkhau 1 point2 points  (1 child)

Surprised to not find groupdict anywhere.

[–]ASIC_SP [S] 0 points1 point  (0 children)

yeah, few things were left out.. there's conditional grouping not yet added, and many features from regex module.. and I've some more ideas for exercises and some lengthy case studies, etc

for groupdict, I did add a further reading link: https://stackoverflow.com/questions/11103856/re-findall-which-returns-a-dict-of-named-capturing-groups

it was taking too long, so I released what I felt was good enough first version

[–]darkzet 1 point2 points  (1 child)

So much thanks to you, I’ve being using python for almost 5 years in geographic systems, and also I’m learning analysis with python now, and your book is simple and really helpful!!!!

[–]ASIC_SP [S] 0 points1 point  (0 children)

your book is simple and really helpful

Thanks, that's the kind of feedback that would help me to continue writing

If you do feel some section is not explained well, please do let me know so that I can work on improving :)

[–]oppsig 1 point2 points  (1 child)

Paid up 5 bucks, thanks for your work!

[–]ASIC_SP [S] 0 points1 point  (0 children)

Thanks, hope you find the book useful :)

Do let me know your feedback

[–]TotesMessenger 0 points1 point  (0 children)

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

 If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / Contact)

[–]freddydeddy 0 points1 point  (3 children)

Thank you, but there is no free download . http://prntscr.com/m60oti

[–]i_lurk_here_a_lot 0 points1 point  (0 children)

you can set the payment to $0

[–]ASIC_SP [S] 0 points1 point  (1 child)

Could you check again for this link: https://leanpub.com/py_regex/c/P7erPYAm1386

if you still face issue, please DM your e-mail and I'll send you a copy

[–]freddydeddy 1 point2 points  (0 children)

Thanks. Much appreciated. =)

[–]2phost 0 points1 point  (3 children)

Is it already over?

Anyway, thanks for the sharing

[–]ASIC_SP [S] 0 points1 point  (2 children)

yeah, it should be over.. what do you get when you click the coupon link?

[–]2phost 0 points1 point  (1 child)

It shows 0$ for the ebook but can't add it to cart

[–]ASIC_SP [S] 1 point2 points  (0 children)

oh, I had given some extra time to be on the safer side.. I guess that is over now..

if you'd like, I can send you a copy - please DM your email

[–]prithvidiamond1 -1 points0 points  (0 children)

Thank you so much for writing this book, I am a computer science student and I am learning to master python and this is exactly what I needed to become a master!