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:
NetSplat and WebCat2 (1997)
HTML authentication HTML page (1999)
Changing price for a SLU based on options (size, etc.) (1997)
Date math format (1998)
Addition: Image size tags (2000)
Group Updates (1998)
Summing fields (1997)
WordBreak Qestion (part 2) (1998)
OSX 4.5 webstar (2002)
Webmerchant confirmation hooks? (1997)
PCS Emailer's role ? (1997)
A little syntax help (1997)
New cart in ShoppingCarts (2003)
Car Database (2002)
Problems with [Applescript] (1997)
WCf2 and nested tags (1997)
RE: protect tag on NT (1997)
Secure server question (1997)
Fedex integration (2004)
WebCat2b13MacPlugIn - More limits on [include] (1997)