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:
WebCatalog can't find database (1997)
Country & Ship-to address & other fields ? (1997)
Question (2000)
[WebDNA] unsubscribe (2008)
Shipping based in distance and weight (1999)
flushdatabases (2000)
2nd WebCatalog2 Feature Request (1996)
Bug or syntax error on my part? (1997)
RE: E-mailer error codes (1997)
Re1000001: Setting up shop (1997)
Multiple prices (1997)
customizing the color of user's pages (1997)
WebCat & WebTen (1997)
WebCatalog can't find database (1997)
Search Command ... A minute ago this worked...? (2000)
webmerchant - Crediting Back (2000)
Viewing old carts (was FEW QUESTIONS) (1997)
RE: Help name our technology! (1997)
hideifs using [date] (1999)
Search/sort in URL Was: GuestBook example (1997)