Regular Expressions - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Regular Expressions

Description:

Regular Expressions. Regular expressions. Regex. Describes a pattern in text. Used in search ... Pattern p=Pattern.compile('[Aa]'); Matcher m=p.matcher(myText); Tutorial ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 5
Provided by: robertb61
Category:

less

Transcript and Presenter's Notes

Title: Regular Expressions


1
Regular Expressions
2
Regular expressions
  • Regex
  • Describes a pattern in text
  • Used in search
  • A regex can be very complex
  • Escaped characters (\d is any digit)
  • In a JAVA string use \\d

3
Character classes
  • Any character dot (.)
  • Whitespace \s (not ws \S)
  • Digit \d (not digit \D)
  • Word char \w (not word char \W)
  • A-Za-z all upper and lower case letters
  • A-F any char except A thru F
  • Aa rose

4
Regex API
  • java.util.regex.
  • Pattern pPattern.compile(Aa)
  • Matcher mp.matcher(myText)
  • Tutorial
  • http//java.sun.com/docs/books/tutorial/extra/rege
    x/
Write a Comment
User Comments (0)
About PowerShow.com