From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp6.jps.net ([216.119.0.86]) by hawkwind.utcs.toronto.edu with SMTP id <25324>; Mon, 27 Mar 2000 00:24:49 -0500 Received: from pkwksj.sjna.corp.dom (209-239-210-164.oak.jps.net [209.239.210.164]) by smtp6.jps.net (8.9.3/8.9.0) with SMTP id MAA24750; Sun, 26 Mar 2000 12:54:39 -0800 (PST) From: "kim kubik" To: Cc: "sam Fans" Subject: Re: the obvious. =) Date: Sun, 26 Mar 2000 15:54:17 -0500 Message-ID: <01bf9765$97d9fd00$a4d2efd1@pkwksj.sjna.corp.dom> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 -----Original Message----- From: James A. Robinson To: kim kubik Cc: sam Fans Date: Saturday, March 25, 2000 5:54 PM Subject: Re: the obvious. =) >> >,x/^\/\*(.+\n)+ \*\/\n/ t /}\n/ >> >> this just ran up against my (mis)understanding of >> sam's regexp's. > > >Here's what I *think* is going on, but I'm no regex guru... A '(.*\n)+' >would keep it going to the end of the file. With '(.+\n)+' I'm specifying >that there must be at least one character before the newline. So this >match ends at the first blank line. I think the engine then backtracks >until it finds a match for ' \*\/' Jim - I tried a couple of different scenarios on before I posted and *think* a blank line was one of the first I tried since the . in (.+\n)+ obviously needs to match something "real". Since I can't remember exactly, my best guess is that what I tried must have been something like: /** * stuff about foo * * and the above is a "blank" line * only if you're a total moron. . . */ which should put me in the forefront of those nominated for the Homer Simpson Award, Year 2000 ("Doooh!"). Since you seem to like to pass around neat SREs, there are times when it's necessary to convert a txt file to html and using a sam "macro" file that I stick off to the side next to the txt file (and using # faux-comments to remind me what each does), there are things in txt2htm.sam like: # Do these guys: &, <, > : [,x/&|<|>/{ g/&/c/&/ g//c/>/ }] where double clicking inside the last [bracket] backhilites this section (but not the [ ] brackets), snarf it, click in the text file, sam it, and send it. Bang, end of story. And when casually perusing the text, if I note something worth embolding, backhiliting the text of interest and snarfing this from the "macro" file, sam-ing the text file and sending: # BOLD FACE DOT: [s/./&/ a/<\/b>/ ] does just that. And tho old habits are difficult to break, I've learned (but still find myself forgetting) that one does not need the samX cursor-arrow keys if you just STAY IN THE SAM COMMAND WINDOW and move around using /re and -/re. It is so much easier than cursoring around, trying to remember which -Duh moves right one word, whatever. You're looking at 'miscake' and want it to be 'mistake' and almost as if sam can read one's mind, you just dot-out and send the cursor there in one move, make the correction, and get back where you were. If you're at the EOF when you dot-out of text entry, it's easy to get back; otherwise one can type e.g. zz, then dot out, make the correction, and get right back to zz and continue on. Maybe all this is obvious to everyone but me. . . most things are. - kim