1 / 10

Pattern Matching

Pattern Matching. CSCI N321 – System and Network Administration. Section Overview. Regular Expressions Matching Characters Grouping/Repetition Characters Tagging (Buffering) Character Classes. CQU 85321 System Administration Course. References. Textbook Chapter 7. Lectures 1999 #7.

kovit
Télécharger la présentation

Pattern Matching

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pattern Matching CSCI N321 – System and Network Administration

  2. Section Overview • Regular Expressions • Matching Characters • Grouping/Repetition Characters • Tagging (Buffering) • Character Classes

  3. CQU 85321 System Administration Course References Textbook • Chapter 7 Lectures • 1999 #7

  4. Pattern Matching • Powerful tool to extract/modify file data • Regular Expressions • Special “string” used to match patterns • Special (Meta) Characters • Matching • Grouping/Repeating • Tagging (buffering) • Use with ASCII files

  5. Programs supporting REs • Extracting information • grep • egrep • Modifying information • sed & awk • ex & vi • Filename globbing versus REs

  6. Matching Characters

  7. Grouping/Repetition Characters

  8. Tagging (Buffering) • Takes the output from one RE and uses it again later • REs to reuse are in \( \) - Tagging • Buffers are referenced by \n where n is the register number $ egrep ‘([a-z])([a-z])\2\1’ /usr/share/dict/words Would return words like attach, better, and common.

  9. RE Character Classes

  10. RE Character Classes (Con’t)

More Related