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:
Memory Error message (1998)
anyone interested in doing an open-source WebCat based forum? (2002)
Calculating multiple shipping... (1997)
mySQL --- problem?? (2004)
PIXO (1997)
WebCatalog for Postcards ? (1997)
Help name our technology! I found it (1997)
Trouble with formula.db + more explanation (1997)
small hairball -- stuck on [showif] for related db (1998)
Explorer 3.0/ Access Denied! (1997)
Providing hard copy of database to client (1997)
WebCatalog/Mac 2.1b2 New Features (1997)
Lost Field (1998)
Browser frames and URLs in the Location field (2004)
[isfile] ? (1997)
emailer (1997)
emailer setup (1997)
Processing all html files through WebCat or Typhoon (1998)
PIXO support (1997)
The beginning (1997)