Regular Expressions Cheat Sheet.pdf - Make Tech Easier...

This preview shows 1 out of 2 pages.

Regular Expressions Cheat Sheet Make Tech Easier “A regular expression is a specific pattern used in computing that provides concise and flexible means to "match" (specify and recognize) strings of text, such as particular characters, words, or patterns of characters. Common abbreviations for "regular expression" include regex and regexp.” Wikipedia Character Description Example . (dot) Match any single character, except newline (\n) c.t matches "cat", "cut" or "cot." * (star) Repeat the previous expression 0 or more times (greedy mode) 12*3 matches "13", "123", "1223", "12223". It can be used together with . (dot) such as m.*easier to match "maketecheasier". + (plus) Repeat the previous expression 1 or more times. 12+3 matches "123","1223","12223" ? (question mark) Makes the previous item optional. ma?ke matches "make", "mke" ^ (caret) Match from the beginning of the string ^he matches "hello", "hell", "help", "he is a boy" $ (dollar) Match from the end of the string ed$ matches "acted", bed", "greed" (...) (round bracket) Grouping of characters or expression (ak) matches "make", "take", ' {n} (curly bracket, where n >= 1)
Image of page 1

Subscribe to view the full document.

Image of page 2
You've reached the end of this preview.
  • Spring '16

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern