Help needed with regular expressions

der.hans PLUGd at LuftHans.com
Wed Jan 25 19:17:56 MST 2006


Am 25. Jan, 2006 schwätzte John Wheat so:

> I am seeking help to memorize, utilize, and gain basic proficiency with 
> regular expressions and sed, grep, egrep searches and the like. When I read 
> something like \^{a-r}\ my brain for lack of a bettwer way to say it believes 
> this to be a ctl-d and stops all processing. So if you have a tool or an 
> acronym or perhaps a silly song you have made up that would help me learn 
> this aspect of CLI interaction would you please share that information with 
> me.

Use them :).

Presuming you're using them for scripts make sure to document:

1. what you're trying to match
2. what the regex is supposed to be doing
3. what each part of the regex is supposed to be doing

As you get better 3 can go away for simple regexes, but I suggest
always doing 1 and 2. I also suggest continuing with 3 for complex or
'cool' regexes.

You might also want to do:

4. give samples that do or don't match and why

ciao,

der.hans
-- 
#  https://www.LuftHans.com/        http://www.CiscoLearning.org/
#  Join the League of Professional System Administrators! https://LOPSA.org/
#  If you're not learning, you're not living. - der.hans


More information about the PLUG-discuss mailing list