Re: Need Regular Expressions?
From: John Nurick (j.mapSoN.nurick_at_dial.pipex.com)
Date: 02/14/05
- Next message: John Nurick: "Re: Image Comparison/Histogram"
- Previous message: Roy Laws: "RTF Control"
- In reply to: alr: "Re: Need Regular Expressions?"
- Next in thread: alr: "Re: Need Regular Expressions?"
- Reply: alr: "Re: Need Regular Expressions?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Feb 2005 20:22:20 +0000
I'm perfectly happy with regexes in a production situation, and have
never heard of problems caused by using the VBScript regular expression
object in VBA code (my own testing has included running queries that
create and destroy a regex object millions of times in order to see if
there are memory or resource leaks).
It's also worth noting that the .Net framework includes a regex engine
(whose regexes are a superset of those available in VBScript).
Here are a couple of links to get started:
http://msdn.microsoft.com/library/en-us/script56/html/reconintroductiontoregularexpressions.asp?frame=true
http://msdn.microsoft.com/library/en-us/script56/html/vtoriregularexpressionsobjectpropmeth.asp?frame=true
The book Mastering Regular Expressions by Jeffrey Friedl (O'Reilly) is
the nearest there is to a standard text; I don't think it specifically
discusses the VBScript regex engine, but most of it will work anyway.
Likewise the O'Reilly Regular Expression Pocket Reference.
On Mon, 14 Feb 2005 10:53:02 -0800, alr <alr@discussions.microsoft.com>
wrote:
>Thanks for your input. I got things working but now I am working on a more
>permanent solution. I need to save the removed text to a new field and run
>this on some large quantities of data in a production environment.
>
>Is there a better choice of tools or some suggestions for making the regex
>reliable? Obviously rigorous and thorough testing of any solution is
>required. If regex is the best choice, is VBA to VbScript to Regex an
>acceptable way to get there? Are there other options? Is there some
>documentation available? The lack of a manual for these tools has become a
>major irritant in my life or a job security program.
>
>Thanks again,
>
>alr
>
>
>
>
>
>
>"John Nurick" wrote:
>
>> On Wed, 9 Feb 2005 09:39:02 -0800, alr <alr@discussions.microsoft.com>
>> wrote:
>>
>> >Of course this was at my expense since I must maintain this code. Any clues
>> >on how to keep it simple?
>>
>> If you don't let them change the rules you won't have to change the
>> code.
>>
>> IME it's easier to maintain one regex than the tens or hundreds of lines
>> of code that would otherwise be needed to implement the same rules. (And
>> the nice people who design and build regex engines must feel the same
>> way or they'd spend their time doing something else.)
>>
>> Pace Maury, it's not regexes that are error prone but the people who
>> write them (me included). It's all too easy to develop a regex that
>> seems to do the job, and then move on to something else without testing
>> it thoroughly. Later on, with unexpected input, it may give you
>> unexpected output - but that means it's wrong, not broken<g>.
>>
>> --
>> John Nurick [Microsoft Access MVP]
>>
>> Please respond in the newgroup and not by email.
>>
-- John Nurick [Microsoft Access MVP] Please respond in the newgroup and not by email.
- Next message: John Nurick: "Re: Image Comparison/Histogram"
- Previous message: Roy Laws: "RTF Control"
- In reply to: alr: "Re: Need Regular Expressions?"
- Next in thread: alr: "Re: Need Regular Expressions?"
- Reply: alr: "Re: Need Regular Expressions?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|