data-lessons/library-data-intro-DEPRECATED

Regex explanations

weaverbel opened this issue · 6 comments

Hi @drjwbaker
I am a bit of a regex dunce and find it hard to teach the examples in the slides as I am not sure if the examples given are meant to be good examples or bad ones. I have tried to deconstruct them in the class using rexper, regex101 etc to help people understand what the different syntaxes mean but I am sure I have sown more confusion than clarity ;-(. if you upload the slides again, can you please provide some notes of what all the different 'Organise' slides mean? That would be great. Cheers Belinda

@weaverbel So, you want to 'answers' put somewhere?

@drjwbaker I would like an actual explanation of what each of the different regex constructions actually DO, and what is the best and most economical way to write them as people are interested in that. Also it would be good to have examples of regexes they might want to reuse, e.g. the regex to pull out an email address from anywhere. @pitviper6 gave me this one

\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b

and then someone else came up with this one but it wasn't as good.

\b[A-Z0-9.-]+@[A-Z0-9.-]+\b

Also how to pull out postcodes and things like that ...

I know I should probably just put in more time learning all this BEFORE I teach it but that is a luxury I can't afford ;-( Luckily I take a regex wizard with me.

Okay. I'll wrap this up with #24 and get on with it once I've cleared by current marking load!

Work started. See #24 for update.

Done now.

fantastic - thanks James @drjwbaker