regexp

xbury.cs at clearstream.com xbury.cs at clearstream.com
Wed Jan 8 07:37:01 EST 2003


Andu,

I ranted about this sometime ago but the phylosophy behind GREP in
MC is for one liners "only" I was told...

I had a similar problem when parsing control statements in a code translator
and later in my Script Editor for the indexing...

Best is to first find the start of the string and match it's ending string
 (with offset("endofstring",container,posoffirststring). Then you remove the
returns
and then you can use the GREP if you so wish...

Thats's the simple way...
Otherwisely, you could replace all returns with a double character and then
use GREP...
You replace your double character with returns before returning the text...

Last but not least, use the two forms above, identify your chunk, remove the
returns,
replace with matchChunk your string and continue scanning your html...

Hope it helps!
Xavier

> -----Original Message-----
> From: andu [mailto:undo at cloud9.net]
> Sent: 08 January 2003 13:15
> To: metacard at lists.runrev.com
> Subject: regexp
> 
> 
> I need some help with matchChunk(). Here's the problem, I 
> need to parse 
> html pages for a certain chunk and replace it with an other. 
> Unfortunately 
> I cant use the good old "replace x with y in z" because the 
> chunk sometimes 
> is on one line other times on many.
> Here's an example:
> 
>         <p><font face="Arial" size="2"><b>Welcome
>           <!user-name>
> 
>           to our site</b></font> </p>
> 
> I want to replace "Welcome <!user-name> to" with "This is", 
> for example.
>  I've spent hours trying to find the right matchChunk() 
> expression given I 
> know the first (Welcome) and last word (to) of the chunk but without 
> success, I can only get one of them at a time. Thanks in 
> advance for any 
> suggestions.
> 
> Regards, Andu Novac
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
> 


Visit us at http://www.clearstream.com
                                                          
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream International does not accept legal responsibility for the contents of this message.

The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be the views of Clearstream International or of any of its affiliates or subsidiaries.

END OF DISCLAIMER



More information about the metacard mailing list