regexp

andu undo at cloud9.net
Wed Jan 8 10:57:01 EST 2003


--On Wednesday, January 08, 2003 09:11:05 -0600 Ken Ray 
<kray at sonsothunder.com> wrote:

> Sorry about that... hit the Send button too soon.
>
> The key to remember in MC (after 2.4.2 where PCRE was added) is the
> modifier "(?s)" which means to "treat the entire chunk of text as my
> string, ignoring newlines". So if you want to get the chunk from the
> beginning of the "W" in "Welcome" to the end ">" in "<!user-name>", you
> can use this:
>
> -- I have your text snippet in field 1
> on mouseUp
>   local tStart,tEnd
>   get matchChunk(fld 1,"(?s)(Welcome.*?<!user-name>)",tStart,tEnd)
>
>   select char tStart to tEnd of fld 1
> end mouseUp
>
> Hope this helps!

Thanks Ken, I knew there was something... The learning curve for metacard 
is very mild but endless. Scott makes sure that we age properly too ;-)

>
> Ken Ray
> Sons of Thunder Software
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
>


Regards, Andu Novac



More information about the metacard mailing list