[opensource] Idea for talk

Paul Betts bettsp at cse.ohio-state.edu
Tue Jan 30 11:29:02 EST 2007


On Tue, 2007-01-30 at 10:47 -0500, BRIAN SWANEY wrote:
> I have no idea what [regular expressions] are.
> 

Well, the easiest way to describe regular expressions is by example. If
I asked someone to describe the format of a telephone number, they'd say
something like "It's 3 numbers in parenthesis, 3 numbers, a dash, then 4
more numbers"

Regular expressions are a standard way to describe the same kinds of
patterns. If I wanted to match a phone number, I'd write: (Yes, there is
a better way to write it, but I'm going for the clean example)

"^(\d\d\d) \d\d\d-\d\d\d\d$"

This looks cryptic, but writing them is actually much easier than
reading them, and there are a _lot_ of useful things that can be done
with these kind of patterns using the two terminal tools 'grep' and
'sed'

If you haven't taken 560 yet, MAKE SURE to learn these and use a
language that has them (C#, Java, Ruby, Python, C/C++ with the PCRE
library), it will make your life infinitely easier. 

-- 
Paul Betts <bettsp at cse.ohio-state.edu>



More information about the Opensource mailing list