Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Regex-tut] What are regular expressions?
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Sat Nov 13, 2004 8:35 pm   Post subject: [Regex-tut] What are regular expressions?

What are regular expressions?

Regular expressions, in practical terms, are a means of performing pattern matching against strings.

Rather than simply comparing two strings for equality, or even comparing ranges of them, regular expressions allow programmers a way to relatively construct powerful, truly flexible patterns. They allow us to not just make simple comparisons, but to identify whole classes of strings.

What do you need?

Regular expressions are almost like a programming language by themselves. The regular expressions I'll be talking about are Perl-compatible. They're so named because the Perl programming language borrowed ideas about regular expressions from various sources and then, because of the popularity of Perl, it created something of a standard for what regular expressions should be.

Many programming languages support the use of Perl-compatible regular expressions. In particular, Perl, Ruby, Python, Java, and C#. Others possess libraries for regular expressions, but don't make them as easy to deal with. Of the five mentioned, only Perl and Ruby feature particular syntax for the creation and use of regular expressions.

For the purposes of demonstrating regular expressions, I'll be using Ruby.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: