Lecture3

Regular expression a powerful tool to deal with

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: arbitrary character: *, ? •  Match specified characters/ranges: •  Are these tools powerful enough? Example: Checking C++ Variable Names •  A C++ variable name –  Can consist of •  Lebers •  Digits •  Underscores –  Should not start with an underscore •  How to check whether a given string is a legit C++ variable name? Regular Expression: A Powerful Tool to Deal with Strings •  RE: A sequence of characters that forms a search pabern, mainly used for string matching •  Metacharacters to improve the flexibility of paberns •  Backreferences to extract substring •  Widely used by different languages •  NOTE: not all the commands support regular expression (hint: check the manual) RE: Metacharacters Character Meaning ^ Beginning of a line/string $ End of a line/string . Any single character...
View Full Document

This note was uploaded on 10/17/2013 for the course CS 35L taught by Professor Eggert during the Fall '09 term at UCLA.

Ask a homework question - tutors are online