irregular expression

Jim Ault JimAultWins at yahoo.com
Sun Jul 16 08:20:20 EDT 2006


On 7/16/06 4:51 AM, "Terry Vogelaar" <tvogelaar at de-mare.nl> wrote:

> The problem was case sensitivity indeed. Thanks for the responses.
> 

Yes, Terry, I thought you did exactly what you wanted.

The reason for my detailed response is that RegEx is quite confusing and I
took the opportunity to show those new to this area some of the rules.  In
the beginning, RegEx is quite a struggle to get what you want...  to
actually *work*

Glad you found your answer.

Jim Ault
Las Vegas


> To answer Marks question: Dar was right. The slash with the question
> mark was to match zero or one slashes, so this regex also matches the
> closing tags.
> 
> So it matches between "<" , followed by zero or one slashes, followed
> by "a", followed by any number of characters other than ">", followed
> by ">". This can never be too greedy or not greedy enough because of
> the [^>]* part. Only when there would be another another tag in the
> HTML file that has got nothing to do with a link, like "<address></
> address>", it replaces too many instances. Luckily that doesn't
> bother me in this case.
> 
> 
> Terry
> 
> 
> Op 15-jul-2006, om 19:00 heeft use-revolution-
> request at lists.runrev.com het volgende geschreven:
> 
>> On Jul 15, 2006, at 7:34 AM, Mark Greenberg wrote:
>> 
>>>> put replacetext(myVar,"</?a[^>]*>","") into myVar
>> 
>>>  but why do you have /? in your RegEx string?
>> 
>> I think I can guess that one, Mark.  From one of my pages:
>> 
>>        <a href="rev.html">Revolution</a><br>
>> 
>> I think Terry's intent is to change that to this:
>> 
>>        Revolution<br>
>> 
>> So both the <a and </a must be matched.  The optional slash does that.
>> 
>> (The regex does not handle a ">" in an attribute string, say, for
>> title, but maybe there cannot be one.)





More information about the use-livecode mailing list