...

View Full Version : Regular expression syntax



yellow_mongoose
09-25-2009, 03:43 AM
Do most programming/computer languages use basically the same syntax for regular expressions as Unix programs like grep and vi? I've been having trouble learning regexps because they seem to be different for each language, like in SQL the symbol for a single character is an underscore while in the vi editor it's a period. vi is my first experience with regular expressions, and I have written a spellchecker script for vi that relies heavily on them. It would make work easier if I could go into using other programs and languages and find a familiar and ubiquitous syntax for regexps. Is there any such standard syntax?

Trinithis
09-25-2009, 08:17 AM
Here are the most common ones
http://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions
http://en.wikipedia.org/wiki/Regular_expression#Syntax

Almost every language I've seen use very similar (if not the same) regex syntax.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum