Erich Purpur
Research Librarian for Science & Engineering
[email protected]
Brown Science & Engineering Library room I046
I'm a part of a group called research data services and I do these things:
1. Serve as Liaison to various engineering departments
2. Teach workshops and classes (like this one)
3. Help people with research projects
4. Random other things as they come up
A regular expression (shortened as regex or regexp also referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. It is a technique developed in theoretical computer science and formal language theory.
Regular expressions can be used in most if not all programming languages. They are like a mini-language in themselves. While they can be somewhat difficult to read, with a little practice they are not overly complicated.
Because regular expressions are language agnostic, I have provided examples of how to use them for both Python (regularexpressions.ipynb) and R (regularexpressions.rmd). I am not an R user so I did my best to translate the python examples to R. The regular expressions themselves between the two languages are nearly identical, so you can translate from one language to another. I am sure my R code is not good so please cut me some slack!
Corey Schafer Regular Expressions
Corey Schafer Python re Module
I heavily used these youtube videos to create this workshop. I used these when I was first learning regular expressions. Regular Expressions are not something I use regularly so every time I needd to use them, I refer to these videos. I more or less re-created these youtube tutorials for this workshops because I didn't think I could do any better! These videos are very clearly explained and easy to follow. I highly recommend them.
StackOverflow is a huge user community Q&A type site. Odds are very high that someone has asked your question before, just google something like "how to make scatter plot matlplotlib python". I'm pretty certain a StackOverflow thread will be one of the first few search results