Re: Which RegEx Testing Tool Do You Prefer?



Kevin, have you ever heard the expression "preaching to the choir?" :-)

I've got the basic pattern matching theory understood but its the use of
expressions to disallow or replace certain characters and/or strings that
I'm trying to really understand thoroughly. The following example
illustrates...

// Example
Lawn Mowers, Repairs & Services - lawnmowers.com

A typical page title that when entered into a TextBox meant to capture
string data for an RSS 2.0 title element should use & instead of the &
to represent the ampersand. I've got an expression that works well for the
example but can't figure out (with the expression I have) how to match the &
and replace it with & (yet) -- or -- how to use the expression I have to
force the 2.0 Regular Expression Validator to fail when the & is present in
the string.

// Expression
[a-z]+([a-z0-9-]*[a-z0-9]+)?(\.([a-z]+([a-z0-9-]*[a-z0-9]+)?)+)*

I also really appreciate Expresso's Analyzer. It is outstanding that
Expresso seems to make it easy for us to pick expressions apart piece by
piece and explain them in English.


<%= Clinton Gallagher






"Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:Ow%23z$7azFHA.1264@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Juan,
>
>> The kind of RegEx tool I'd like is one which can take a string
>> I write, and create a RegEx expression which matches it.
>
> The problem with that is that you can write a Regular Expression that
> matches a literal string quite easily. For example:
>
> literal string
>
> The above is a regular expression which will match the substring "literal
> string" in my first sentence. Of course, the real power of regular
> expressions is the abilty to match *patterns* in a string, perform
> grouping, etc. So, like any programming language (which it is, in a
> sense), Regular Expressions have a shorthand syntax that allows one to
> create patterns of a large variety of types. A simple example of this
> would be:
>
> (literal) (string)
>
> This captures the same match as the first, but puts the string "literal"
> into a group, and the string "string" into a second group. But of course,
> we have already exceeded your desired requirement. On the other hand, we
> have made a regular expression that is perhaps more useful (in some
> situations) than the first.
>
> And of course, the possible types and combinations of patterns are almost
> endless, including wildcard patterns, special characters, boolean rules,
> and so on.
>
> Yeah, it's like reading some kind of incredibly concise shorthand code,
> without even line breaks or brackets to help. That's why I was so pleased
> to see that Expresso allows you to break your regular expression across
> multiple lines while building it. That helps a good bit!
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Ambiguity has a certain quality to it.
>
> "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> wrote in message
> news:eivH4pazFHA.2880@xxxxxxxxxxxxxxxxxxxxxxx
>> The kind of RegEx tool I'd like is one which can take a string
>> I write, and create a RegEx expression which matches it.
>>
>> *That* will be the RegEx tool that will corner the market.
>>
>>
>>
>>
>> Juan T. Llibre, ASP.NET MVP
>> ASP.NET FAQ : http://asp.net.do/faq/
>> Foros de ASP.NET en Español : http://asp.net.do/foros/
>> ======================================
>> "clintonG" <csgallagher@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
>> message news:OfUTuiazFHA.1616@xxxxxxxxxxxxxxxxxxxxxxx
>>> Thanks Kevin. I saw that post too and am going to download Expresso in a
>>> few minutes. I know you don't need to be psychic to figure out what I'm
>>> likely to be asking next :-)
>>>
>>> <%= Clinton Gallagher
>>>
>>>
>>> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>>> news:O0evUEazFHA.2792@xxxxxxxxxxxxxxxxxxxxxxx
>>>>I saw a response to this question in the CSharp group, regarding a
>>>>product named "Expresso"
>>>>
>>>> http://www.ultrapico.com/Expresso.htm
>>>>
>>>> Expresso is .Net freeware, and after downloading, installing, and
>>>> playing with it, I'd give it a try! So far I have found it to be
>>>> excellent, having capabilities that Regex Buddy does not have, and a
>>>> much more intuitive GUI.
>>>>
>>>> --
>>>> HTH,
>>>>
>>>> Kevin Spencer
>>>> Microsoft MVP
>>>> .Net Developer
>>>> Ambiguity has a certain quality to it.
>>>>
>>>> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>>>> news:%23bxsOlZzFHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> Hi Clinton,
>>>>>
>>>>> Yes, I have it. I previously used the freeware Regex Coach Utility,
>>>>> but it is nowhere near as complete in its support for various newer
>>>>> Regular Expression syntax and programming languages in general. It did
>>>>> have one nice feature about it. You could split a Regular Expression
>>>>> across multiple lines, which often made it easier to analyze. However,
>>>>> Regex Buddy has the graphical tree view, and it is synchronized with
>>>>> the Regular Expression itself, which more than makes up for the
>>>>> omission of breaking a Regular Expression across multiple lines.
>>>>>
>>>>> BTW, it also has a GREP utility built in.
>>>>>
>>>>> In short, it is well worth the 30 bucks.
>>>>>
>>>>> --
>>>>> HTH,
>>>>>
>>>>> Kevin Spencer
>>>>> Microsoft MVP
>>>>> .Net Developer
>>>>> Ambiguity has a certain quality to it.
>>>>>
>>>>> "clintonG" <csgallagher@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
>>>>> message news:%23yIAzKVzFHA.3660@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>I was looking at PowerGrep from the same dev group but like Regex
>>>>>>Buddy I don't like the buy before you try business model so that
>>>>>>choice has to be on the shelf for the moment but thanks for bringing
>>>>>>it up. I assume you've used Regex Buddy?
>>>>>>
>>>>>> <%= Clinton Gallagher
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>>>>>> news:%23$hJGuTzFHA.664@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>> Regex Buddy is very good. It costs around $30.00, includes quite a
>>>>>>> few nice features, including the ability to copy regular expressions
>>>>>>> in various language string syntaxes, including C#. It has the
>>>>>>> ability to create libraries of regular expressions, a nice visual
>>>>>>> builder, color-coding, and quite a bit more. Good testing
>>>>>>> environment. And it has some nice reference material included.
>>>>>>>
>>>>>>> --
>>>>>>> HTH,
>>>>>>>
>>>>>>> Kevin Spencer
>>>>>>> Microsoft MVP
>>>>>>> .Net Developer
>>>>>>> Ambiguity has a certain quality to it.
>>>>>>>
>>>>>>> "clintonG" <csgallagher@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
>>>>>>> message news:%23e%23mQdTzFHA.2792@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>> I'm using an .aspx tool I found at [1] but as nice as the interface
>>>>>>>> is I think I need to consider using others. Some can generate C# I
>>>>>>>> understand. Your preferences please...
>>>>>>>>
>>>>>>>> <%= Clinton Gallagher
>>>>>>>>
>>>>>>>> [1] http://forta.com/books/0672325667/
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.


Loading