Re: grep matching
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 47885
interpreted = N
texte = This grep SHOULD work:[grep search=\[([^\-]*)->([^\]]*)\]&replace=
\1]but it doesn't under WebDNA 4.5 / OSX... which seems to have a problem putting an end square bracket into a character list.Essentially, the above says find [, then select the next N characters that are not -, then skip over the -> and select the next N characters that are not an end square bracket ].I tried everything I could think of to be able to search for an end square bracket within a character list (delimited by [] in grep), but it will not work. I can search for the character by itself, and I can make it work in a character list in BBEdit, but I can't make it work in WebDNA.SM: Is this a bug?The workaround it to replace the square brackets with something you can search for first, for example, curly braces. This one works for me:[grep search={([^\-]*)->([^}]*)}&replace=
\1][grep search=\%5B&replace={][grep search=\%5D&replace=}][SOURCEDATA][/grep][/grep][/grep]- brianOn Wednesday, February 19, 2003, at 06:22 AM, laurent pladys wrote:> hi,>> i am trying to implement the SPIP (www.spip.org) content management> system and word macro in some of my webdna page. basically you do your> page layout and links in word, hit a macro button and all you have to> do is paste the result in a text area to have SPIP transform the > special> meta tags into regular html tags.> For example the following :>> ---> {{{title}}}> go to [some web site->http://www.somewebsite.com]> {cool no} ?> --->> transforms into> --->
title
> go to
some web site>
cool no ?> --->> I managed to transform the {{{ with convertwords and a special > database.>> My problem is converting [some web site->http://www.somewebsite.com] > into>
some web site> I used : [grep search=\[(.*)->(.*)\]&replace=
href=\2>\1][include> spiplike.inc][/grep]> but it looks like that if I have 2 links in the same file the grep > only> happens once and it tries to do the grep on all the links at once.>> Is there a way to tell grep to match the shortest string possible ?>> You can see a sample of the result here : > http://www.lxir.net/demos/spip/>> Laurent>>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list
.> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
This grep SHOULD work:[grep search=\[([^\-]*)->([^\]]*)\]&replace=\1]but it doesn't under WebDNA 4.5 / OSX... which seems to have a problem putting an end square bracket into a character list.Essentially, the above says find [, then select the next N characters that are not -, then skip over the -> and select the next N characters that are not an end square bracket ].I tried everything I could think of to be able to search for an end square bracket within a character list (delimited by [] in grep), but it will not work. I can search for the character by itself, and I can make it work in a character list in BBEdit, but I can't make it work in WebDNA.SM: Is this a bug?The workaround it to replace the square brackets with something you can search for first, for example, curly braces. This one works for me:[grep search={([^\-]*)->([^}]*)}&replace=\1][grep search=\%5B&replace={][grep search=\%5D&replace=}][SOURCEDATA][/grep][/grep][/grep]- brianOn Wednesday, February 19, 2003, at 06:22 AM, laurent pladys wrote:> hi,>> i am trying to implement the SPIP (www.spip.org) content management> system and word macro in some of my webdna page. basically you do your> page layout and links in word, hit a macro button and all you have to> do is paste the result in a text area to have SPIP transform the > special> meta tags into regular html tags.> For example the following :>> ---> {{{title}}}> go to [some web site->http://www.somewebsite.com]> {cool no} ?> --->> transforms into> ---> title
> go to some web site
> cool no ?> --->> I managed to transform the {{{ with convertwords and a special > database.>> My problem is converting [some web site->http://www.somewebsite.com] > into> some web site> I used : [grep search=\[(.*)->(.*)\]&replace= href=\2>\1][include> spiplike.inc][/grep]> but it looks like that if I have 2 links in the same file the grep > only> happens once and it tries to do the grep on all the links at once.>> Is there a way to tell grep to match the shortest string possible ?>> You can see a sample of the result here : > http://www.lxir.net/demos/spip/>> Laurent>>> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Brian Fries
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Using webcat to roll apache logs (2002)
[WebDNA] "sem_open" bug (2012)
Major Security Hole IIS NT (1998)
Cart Creation (1998)
Need help with emailer- 2 issues (1997)
[shell] (2005)
It just Does't add up!!! (1997)
dos performance (1998)
RE: Is there an easier way? (1998)
denied access (1997)
New user...how do I create URLs from form fields? (2000)
RE: Timer Values on [redirect] (1998)
What does this error mean? (2000)
donation (2000)
getting images' width/height (1998)
SiteGuard Use Question (1997)
Max Record length (1997)
[ShowNext] (1997)
[WebDNA] [OT] For Will (2009)
request for comment tag (1998)