![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4
![]() |
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?
|
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#3 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
(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. |
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|