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:
RE: Signal Raised (1997)
Ship Cost Calculated via Subtotal (1998)
Searching a database... (2003)
Replace Statement (1997)
Comments in db? (1997)
Silly Question (2003)
Looking for host (1999)
THANKS (1997)
no global [username] or [password] displayed ... (1997)
WC2b15 File Corruption (1997)
[WebDNA] XML parsing issue with cdata (2012)
[MIDDLE %22] Broken (2003)
WebCatalog2 Feature Feedback (1996)
creator code (1997)
RE: NewCart+Search with one click ? (1997)
WCS Newbie question (1997)
PSC recommends what date format yr 2000??? (1997)
WebCat2b13MacPlugin - nested [xxx] contexts (1997)
[WebDNA] WebDNA hosting options (2020)
Webcat 3.0.5b9, b8 trigger failures ON WEBSTAR (1999)