COS126_Lecture18_Regular_Expressions notes

COS126_Lecture18_Regular_Expressions notes - Lecture 18...

Info icon This preview shows pages 1–2. Sign up to view the full content.

Lecture 18... Audio recording started: 10:02 AM Thursday, April 11, 2013 FROM LECTURE 18, learn Pattern matching question - Is a given string ins a specified set of strings? Regular expressions: Regular expression = a notation to specify a set of strings. .u.u.u. the dots represent any 2 characters ab*a can be aa or abbbbba or abba, etc… b* the set of things that have 0 or more consecutive b's Parentheses can be used to combine regular expressions The set of strings by parentheses can be infinite. Notation can be quite expressive Brackets = anything in that class Any capital letter, and any small letter followed by any small letter [A-Z][a-z] [a-z] Ink saving shortcuts: ^ = not any of what follows the ^ sign. RE = regular expression {2, 4} = between 2 and 4 of the things just before. Matches method - used to check is a given input matches the regular expression. RE's in Java: replaceAll method - can be used to replace any instance of a match of a given regular expressions.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '08
  • Regular expression, Nondeterministic finite state machine, regular expressions, Pattern matching

{[ 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