Day 5(9 17 2019) : Regular Expressions - Ajarlin/Data-Science GitHub Wiki

Regular Expressions

Once you have loaded data, you will often need to find certain data.

match = re.match(r"data science", text) //

match = re.ssearch(r"data sciencce", text) //

#Ex Match Rutger's ID's Rules:

  • Id must have 2-4 alpha characters(eg. adg)
  • Id must have a number [1-5]
  • Id must have rutgers.edu

RegEx: [a-z][2,4][0-9]{1,5}@.*.?rutgers.edu

? == 0 or 1, and try to match to the specific thing, this thing being the .

  • anything 0 or more