Re: GREP Help
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 36601
interpreted = N
texte = Richard Kirsner wrote:> > We're having some fun with GREP in WebCat 4.X. Actually, when it works,> it's really useful and a big timesaver. But we're having some problems with> the following GREP statement. The idea is to take each line that ends> with a> : and change the style on that line only.> > [unurl][Grep search=(^[A-Z].*[%][3][A])&replace=
class=smTxtBldSansBlu>\1][url][convertchars][FEAPICTTEXT1][/convert> chars][/url][/Grep][/unurl]> > This is the sample text from the a field in the database that we're> trying to modify:> > This is a New Feature:> This text describes the features.> Isn't it a fine set of features.> > This is Second Feature:> This text describes the features.> Isn't it a fine set of features.> > The grep statement is matching all text through the second :, and changing> the style, which we don't want. In this application, the user enters a lot> of text into one field of the database and we want to parse out the> delimited elements.> > What we need is it to match the first line in each para that ends with a> :.> > Any suggestions?> > BTW: anyone found a good GREP reference online? Especially syntax for the> REPLACE actions?> > Richard KirsnerFirst things first, http://www.oreilly.com/catalog/regex/ is the bestgeneral book on regular expressions that I am aware of.Secondly, grep is [typically] a line oriented function, not a block(paragraph) oriented function. That is not to say you cannot use iton multiline blocks, just that it is much harder to get everything correct.The asterisk (*) character is [typically] a greedy match. Try with plus (+) and see if that does what you want. I don't know exactlywhere PCS/SMSI got their grep library; it certainly doesn't see to becomparable to recent GNU grep's and it doesn't include any of theextended Perl grep functionality.HTHJohn--John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Richard Kirsner wrote:> > We're having some fun with GREP in WebCat 4.X. Actually, when it works,> it's really useful and a big timesaver. But we're having some problems with> the following GREP statement. The idea is to take each line that ends> with a> : and change the style on that line only.> > [unurl][Grep search=(^[A-Z].*[%][3][A])&replace= class=smTxtBldSansBlu>\1][url][convertchars][FEAPICTTEXT1][/convert> chars][/url][/Grep][/unurl]> > This is the sample text from the a field in the database that we're> trying to modify:> > This is a New Feature:> This text describes the features.> Isn't it a fine set of features.> > This is Second Feature:> This text describes the features.> Isn't it a fine set of features.> > The grep statement is matching all text through the second :, and changing> the style, which we don't want. In this application, the user enters a lot> of text into one field of the database and we want to parse out the> delimited elements.> > What we need is it to match the first line in each para that ends with a> :.> > Any suggestions?> > BTW: anyone found a good GREP reference online? Especially syntax for the> REPLACE actions?> > Richard KirsnerFirst things first, http://www.oreilly.com/catalog/regex/ is the bestgeneral book on regular expressions that I am aware of.Secondly, grep is [typically] a line oriented function, not a block(paragraph) oriented function. That is not to say you cannot use iton multiline blocks, just that it is much harder to get everything correct.The asterisk (*) character is [typically] a greedy match. Try with plus (+) and see if that does what you want. I don't know exactlywhere PCS/SMSI got their grep library; it certainly doesn't see to becomparable to recent GNU grep's and it doesn't include any of theextended Perl grep functionality.HTHJohn--John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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://search.smithmicro.com/
John Peacock
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:
Document Contains No Data! (1997)
Kill the webcat process (2000)
Database Upload (2000)
Many $WebCat.exe processes (1998)
Upgrading old WebCat Database Files (1997)
RE: WebCat: Access denied, but why? (1997)
Textarea (1998)
Cart Numbers (1997)
acrobat -> wc (1998)
Concealing WebCatalog in the URL (2000)
WCS Newbie question (1997)
help (2001)
Multi-Row Tables from a search. (1997)
PCS Frames (1997)
Interpret Around Contexts? (2000)
RE: OK, here goes... (1997)
Re:trouble (1997)
WebCat for Unix?? (1997)
Can WebDNA do this? (2000)
Slightly [OT] Trying to get clients SQL system going (2005)