Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 1st, 2005, 12:16 PM   #1
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
what is regular expressions categorized as?

hi i was wondering what you'd catergorize [Rr][Ee][Gg][Ee][Xx] as? It's not really a language or anything right? Also if you use it in code would it slow down your program because the expression(s) need to be evaluated? If so is it really a big performance difference?
linuxpimp20 is offline   Reply With Quote
Old Oct 1st, 2005, 12:45 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Regular expression evaluation is a tool. Some languages have such tools built into common libraries, some don't. Regular expression evaluation is a performance hit for simple things that can be done with compare or substring functions, indispensable for complex things. Validating an email address that works for a very large majority is simple, for instance. Validating an email address for 100% compliance with the RFC isn't.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 1st, 2005, 12:47 PM   #3
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Quote:
Originally Posted by DaWei
Validating an email address for 100% compliance with the RFC isn't.
Amen!

(See RFC 822) an example of a valid email address:

Barnabas <"Old Blind Crippled"@wac.com (this email is only valid until yesterday)>

:p
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty

Last edited by stevengs; Oct 1st, 2005 at 1:07 PM.
stevengs is offline   Reply With Quote
Old Oct 5th, 2005, 4:44 PM   #4
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
regular expressions have a base in math.

The example you posted is more usually called classes, a subset of regular expressions.

DaWei is correct in saying that that RE are builtins and not always there, but that's correct only for older systems.

From XP (.NET) on they are/will be there and any POSIX-compliant unix has to support them. There are even COM objects for VB6 that support them, too.
jim mcnamara is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC