Coder Social home page Coder Social logo

regex-intro's Introduction

Introduction to Regular Expressions

Are you trying to search for or clean up certain segments of text in your documents or data files, but it's taking hours to search and replace, because you have to type many slightly different versions of the keywords you're searching for? Perhaps you need to replace month names with just the first three letters, but you don't want to do this 12 times (once for each month), for lowercase, capitalized first letter, and all-caps versions? Or perhaps you only want to do so when the month name is part of a full date expression, e.g. "March 2, 2001", but not in the phrase "they're planning a march on Wall Street".

Introducing regular expressions, special text strings that allow you to define text patterns in flexible and complex ways. Regular expressions are very useful in many applications. They can be used to search for and replace text in a simple text editor, or in your datasets in Python or R. In this workshop, we'll learn how to build regular expressions using special characters, sets or quantities of characters, the absence of certain characters, this-or-that alternatives, and other options. Then we'll briefly demonstrate how to use these expressions in Python and R, to get you familiar with the package you'll use in your own programming.

Technology requirements: Laptop required. Most of the workshop will be done using a web browser, so you will need an up-to-date browser. We recommend Google Chrome. In addition, you will need the Sublime text editor. Follow this link to download and install the version for your operating system.

Optional: If you are already programming in Python or R and want to try out regular expressions in that language, we'll have a brief demonstration of each language's regex package at the end of the workshop. So bring your laptop with your preferred Python or R environment installed. This part is optional; we will not discuss how to begin programming in those languages if you have not already done so.

regex-intro's People

Contributors

henchc avatar natalieahn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

regex-intro's Issues

Note on sets and OR operator

Hey Natalie,

Very handy repo, I have been using it arleady. Quick note on the cheatsheet - if you want to match multiple characters with an OR, the simplest thing is to do [ab]. Just wanted to mention it since there isn't a version under Sets that shows a set of characters that isn't based on a range, and the OR operator line kinda implies that one would need to use "|".

Cheers,
Chris

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.