buggy awk regex handling?

2012-08-02 Thread kaltheat
Hi, I tried to replace three letters with three letters by awk using the sub-routine. I assumed that my regular expression does mean the following: match if three letters of any letter of alphabet occurs anywhere in input $ echo AbC | awk '{sub(/[[:alpha:]]{3}/,cBa); print;}' AbC As you can

Re: buggy awk regex handling?

2012-08-02 Thread RW
On Thu, 02 Aug 2012 13:20:52 +0200 kaltheat wrote: Hi, I tried to replace three letters with three letters by awk using the sub-routine. I assumed that my regular expression does mean the following: match if three letters of any letter of alphabet occurs anywhere in input $ echo

Re: buggy awk regex handling?

2012-08-02 Thread Warren Block
On Thu, 2 Aug 2012, RW wrote: On Thu, 02 Aug 2012 13:20:52 +0200 kaltheat wrote: I tried to replace three letters with three letters by awk using the sub-routine. I assumed that my regular expression does mean the following: match if three letters of any letter of alphabet occurs anywhere in

libc regex word-boundary support fallen-off?

2012-03-08 Thread RW
I've noticed for some time that claws-mail and less (which I think use libc's regex(3)) don't support word boundaries in searches. I might be delusional, but I think I've used \b in the past in both of those applications in FreeBSD. According to regex(3) it's an implementation POSIX.2, so

Re: libc regex word-boundary support fallen-off?

2012-03-08 Thread Carl Johnson
RW rwmailli...@googlemail.com writes: I've noticed for some time that claws-mail and less (which I think use libc's regex(3)) don't support word boundaries in searches. I might be delusional, but I think I've used \b in the past in both of those applications in FreeBSD. According to regex

Re: Regex Wizards

2011-09-27 Thread Wayne Sierke
On Mon, 2011-09-26 at 22:02 -0400, grarpamp wrote: Under the ERE implementation in RELENG_8, I'm having trouble figuring out how to group and backreference this. Given a line, where: If AAA is present, CCC will be too, and B may appear in between. If AAA is not present, neither CCC or B

Re: Regex Wizards

2011-09-27 Thread Matthew Seaman
On 27/09/2011 03:02, grarpamp wrote: Under the ERE implementation in RELENG_8, I'm having trouble figuring out how to group and backreference this. Given a line, where: If AAA is present, CCC will be too, and B may appear in between. If AAA is not present, neither CCC or B will be

Re: Regex Wizards

2011-09-27 Thread joost
Under the ERE implementation in RELENG_8, I'm having trouble figuring out how to group and backreference this. Given a line, where: If AAA is present, CCC will be too, and B may appear in between. If AAA is not present, neither CCC or B will be present. is always present. Junk may be

Re: Regex Wizards

2011-09-27 Thread grarpamp
I think I'm grokking my mistake with the greedy stuff now. I'll try implementing a couple of your suggestions. Thanks guys! ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send

Regex Wizards

2011-09-26 Thread grarpamp
Under the ERE implementation in RELENG_8, I'm having trouble figuring out how to group and backreference this. Given a line, where: If AAA is present, CCC will be too, and B may appear in between. If AAA is not present, neither CCC or B will be present. is always present. Junk may be

Re: regex question....

2010-12-05 Thread RW
On Sat, 4 Dec 2010 20:32:57 -0800 Gary Kline kl...@thought.org wrote: On Sat, Dec 04, 2010 at 06:49:45PM -0800, xSAPPYx wrote: Also, the + operator means '1 or more' but needs escaped: %s/[0-9]\+/foo/g Okay. I thought that the + must be perl-only regex... . It's from Extended

Re: regex question....

2010-12-05 Thread Ian Smith
In freebsd-questions Digest, Vol 339, Issue 11, Message: 30 On Sat, 4 Dec 2010 18:23:08 -0800 Gary Kline kl...@thought.org wrote: On Sat, Dec 04, 2010 at 05:56:59PM -0800, per...@pluto.rain.com wrote: Joshua Gimer jgi...@gmail.com wrote: On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline

Re: regex question....

2010-12-05 Thread Gary Kline
translate to: They're taking their stuf over there. Anybody interested in this, please take it Off-Line, okay. And thax for yer regex help :-) gary -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E

Re: regex question....

2010-12-05 Thread Randal L. Schwartz
Joshua == Joshua Gimer jgi...@gmail.com writes: Joshua On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline kl...@thought.org wrote: I have tried :1,$/s/[0-9]][0-9][0-9]/foo/g Joshua Why not just %s/[0-9]*/foo/g Because that would turn a line of fred into foofred. :) -- Randal L. Schwartz -

Re: regex question....

2010-12-05 Thread Randal L. Schwartz
Gary == Gary Kline kl...@thought.org writes: Gary %s/[1-0][0-9]*/foo/g Except 1-0 is an empty set. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ Smalltalk/Perl/Unix consulting, Technical writing,

Re: regex question....

2010-12-05 Thread Chip Camden
Quoth Polytropon on Sunday, 05 December 2010: PS: See, this is why I keep cheatsheets. ;) That's the fat green book on my shelf. :-) For regex reference, I find this site helpful: http://www.regular-expressions.info/reference.html ... especially regarding differences between

Re: regex question....

2010-12-05 Thread Chip Camden
be perl-only regex... . It's from Extended REs rather than perl specifically, it works with sed -E but not plain sed. Not sure about vi. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions

Re: regex question....

2010-12-05 Thread Gary Kline
On Sun, Dec 05, 2010 at 09:37:58AM -0800, Randal L. Schwartz wrote: Gary == Gary Kline kl...@thought.org writes: Gary %s/[1-0][0-9]*/foo/g Except 1-0 is an empty set. :) Ya, sure, you-betcha! I really did mean a '9'there. For some reason, what I'm thinking

Re: regex question....

2010-12-05 Thread Gary Kline
On Sun, Dec 05, 2010 at 10:11:34AM -0800, Chip Camden wrote: Quoth Polytropon on Sunday, 05 December 2010: PS: See, this is why I keep cheatsheets. ;) That's the fat green book on my shelf. :-) For regex reference, I find this site helpful: http://www.regular

Re: regex question....

2010-12-05 Thread Wayne Sierke
: %s/[0-9]\+/foo/g Okay. I thought that the + must be perl-only regex... . It's from Extended REs rather than perl specifically, it works with sed -E but not plain sed. Not sure about vi. For me in works in vim but not in vi. In vi it requires setting the extended option

regex question....

2010-12-04 Thread Gary Kline
Gang, I was tried to find Jeffrey Friedl's email to figure out some quick regex when it struck me that the list can clue me in [[I have figured this out myself several times--well, 3 or 4 anyway--but it was more trial/error than I need.]] I have a file with ints from 0 to some N. What

Re: regex question....

2010-12-04 Thread Joshua Gimer
On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline kl...@thought.org wrote: I have tried :1,$/s/[0-9]][0-9][0-9]/foo/g Why not just %s/[0-9]*/foo/g -- Thanks, Joshua Gimer --- http://www.linkedin.com/in/jgimer http://twitter.com/jgimer http://itsecops.blogspot.com/

Re: regex question....

2010-12-04 Thread Gary Kline
On Sat, Dec 04, 2010 at 05:29:49PM -0700, Joshua Gimer wrote: On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline kl...@thought.org wrote: I have tried :1,$/s/[0-9]][0-9][0-9]/foo/g Why not just %s/[0-9]*/foo/g So I just missed the *? Didn't need to escape the [ or ] ? ---I'll

Re: regex question....

2010-12-04 Thread Polytropon
On Sat, 4 Dec 2010 17:24:30 -0800, Gary Kline kl...@thought.org wrote: So I just missed the *? Yes. In regex, * means any amount of, if I remember correctly. So you don't have to specify precisely how many numbers there are. How many lights? :-) Didn't need to escape

Re: regex question....

2010-12-04 Thread perryh
Joshua Gimer jgi...@gmail.com wrote: On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline kl...@thought.org wrote: I have tried :1,$/s/[0-9]][0-9][0-9]/foo/g Why not just %s/[0-9]*/foo/g Too broad -- it will match the null string. (* means zero or more instances of whatever preceded it.) Best RE I

Re: regex question....

2010-12-04 Thread Gary Kline
On Sat, Dec 04, 2010 at 05:56:59PM -0800, per...@pluto.rain.com wrote: Joshua Gimer jgi...@gmail.com wrote: On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline kl...@thought.org wrote: I have tried :1,$/s/[0-9]][0-9][0-9]/foo/g Why not just %s/[0-9]*/foo/g Too broad -- it will match the null

Re: regex question....

2010-12-04 Thread xSAPPYx
On Sat, Dec 4, 2010 at 17:56, per...@pluto.rain.com wrote: Joshua Gimer jgi...@gmail.com wrote: On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline kl...@thought.org wrote: I have tried :1,$/s/[0-9]][0-9][0-9]/foo/g Why not just %s/[0-9]*/foo/g Too broad -- it will match the null string.  (* means

Re: regex question....

2010-12-04 Thread Gary Kline
that the + must be perl-only regex... . Then, nutshell, the most simple expression [fewest keystrokes] would be: %s/[1-0][0-9]*/foo/g -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Journey Toward the Dawn, E-Book: http

Re: Regex Help For Procmail

2010-09-09 Thread Glen Barber
On 9/8/10 12:22 PM, Drew Tomlinson wrote: [snip] # Deliver other email to folder :0 * ^From:.*famous-smoke\.com ${HOME}/Maildir/.Shopping/Famous Smoke/Email/ Do you see anything I'm missing? Drew, I'll give this one final shot. Try this: * ^From:(@.*famous-smoke\.com)

Re: Regex Help For Procmail

2010-09-08 Thread Drew Tomlinson
On 9/7/2010 5:50 PM, Robert Bonomi wrote: From owner-freebsd-questi...@freebsd.org Mon Sep 6 12:46:59 2010 Date: Mon, 06 Sep 2010 10:46:47 -0700 From: Drew Tomlinsond...@mykitchentable.net To: per...@pluto.rain.com Cc: fr...@shute.org.uk, freebsd-questions@freebsd.org Subject: Re: Regex Help

Re: Regex Help For Procmail

2010-09-07 Thread Bernt Hansson
2010-09-06 19:46, Drew Tomlinson skrev: On 9/5/2010 4:02 PM, per...@pluto.rain.com wrote: Frank Shutefr...@shute.org.uk wrote: Drew, try this: * ^From:.*famous-smoke\.com I think it's not catching it because the period isn't backslash escaped ... Unless there's some edge case that I'm not

Re: Regex Help For Procmail

2010-09-07 Thread Robert Bonomi
From owner-freebsd-questi...@freebsd.org Tue Sep 7 14:24:56 2010 Date: Tue, 07 Sep 2010 12:01:40 +0200 From: Bernt Hansson be...@bah.homeip.net To: Drew Tomlinson d...@mykitchentable.net Cc: fr...@shute.org.uk, per...@pluto.rain.com, freebsd-questions@freebsd.org Subject: Re: Regex Help

Re: Regex Help For Procmail

2010-09-06 Thread Drew Tomlinson
On 9/5/2010 4:02 PM, per...@pluto.rain.com wrote: Frank Shutefr...@shute.org.uk wrote: Drew, try this: * ^From:.*famous-smoke\.com I think it's not catching it because the period isn't backslash escaped ... Unless there's some edge case that I'm not thinking of, adding a backslash to

Re: Regex Help For Procmail

2010-09-06 Thread Drew Tomlinson
don't think you need the trailing bracket (). What about this: * ^From:.*famous-smoke\.com$ Note that I also escaped the period before 'com'. I think I'd have to have the trailing bracket when specifying the $ at the end. However maybe the bracket is some special regex character

Re: Regex Help For Procmail

2010-09-06 Thread Frank Shute
On Sun, Sep 05, 2010 at 09:33:31AM -0700, Drew Tomlinson wrote: [snip] No, still not matching. Basically, why doesn't this header: From: Famous Smoke Shop annou...@email.famous-smoke.com Match this procmail recipe: :0 * ^From:.*famous-smoke.com$ ${HOME}/Maildir/.Shopping/Famous

Re: Regex Help For Procmail

2010-09-06 Thread Peter Boosten
On 7-9-2010 3:51, Frank Shute wrote: [snip] I additionally don't like the look of your Maildir. It's quoted, you should set MAILDIR in procmailrc, you should get rid of the space and it should end in new. Result: :0 * ^From:.*famous-smoke\.com .Shopping/Famous_Smoke/new I've actually

Re: Regex Help For Procmail

2010-09-05 Thread Drew Tomlinson
On 9/3/2010 2:12 PM, Drew Tomlinson wrote: Hi Glen, Thank you for your reply. On 9/3/2010 12:02 PM, Glen Barber wrote: Hi Drew, On 9/3/10 2:45 PM, Drew Tomlinson wrote: I use procmail for mail delivery and I'm trying to concoct the right regex to match From: headers and deliver

Re: Regex Help For Procmail

2010-09-05 Thread Frank Shute
On Sun, Sep 05, 2010 at 09:33:31AM -0700, Drew Tomlinson wrote: [snip] No, still not matching. Basically, why doesn't this header: From: Famous Smoke Shop annou...@email.famous-smoke.com Match this procmail recipe: :0 * ^From:.*famous-smoke.com$ ${HOME}/Maildir/.Shopping/Famous

Re: Regex Help For Procmail

2010-09-05 Thread Glen Barber
On 9/5/10 12:33 PM, Drew Tomlinson wrote: No, still not matching. Basically, why doesn't this header: From: Famous Smoke Shop annou...@email.famous-smoke.com Match this procmail recipe: :0 * ^From:.*famous-smoke.com$ Hmm.. I just noticed this - I don't think you need the trailing

Re: Regex Help For Procmail

2010-09-05 Thread perryh
Frank Shute fr...@shute.org.uk wrote: Drew, try this: * ^From:.*famous-smoke\.com I think it's not catching it because the period isn't backslash escaped ... Unless there's some edge case that I'm not thinking of, adding a backslash to escape a period will never convert a non-match into a

Regex Help For Procmail

2010-09-03 Thread Drew Tomlinson
I use procmail for mail delivery and I'm trying to concoct the right regex to match From: headers and deliver to a folder. However mail is sent from various addresses so I want to match all that end with famous-smoke.com. Here's an example of a header: From: Famous Smoke Shopannou

Re: Regex Help For Procmail

2010-09-03 Thread Glen Barber
Hi Drew, On 9/3/10 2:45 PM, Drew Tomlinson wrote: I use procmail for mail delivery and I'm trying to concoct the right regex to match From: headers and deliver to a folder. However mail is sent from various addresses so I want to match all that end with famous-smoke.com. Here's an example

Re: Regex Help For Procmail

2010-09-03 Thread Drew Tomlinson
Hi Glen, Thank you for your reply. On 9/3/2010 12:02 PM, Glen Barber wrote: Hi Drew, On 9/3/10 2:45 PM, Drew Tomlinson wrote: I use procmail for mail delivery and I'm trying to concoct the right regex to match From: headers and deliver to a folder. However mail is sent from various

Re: procmail regex help ... sometimes works, sometimes doesn't...

2010-03-29 Thread parv
in message 471394.79697...@web111611.mail.gq1.yahoo.com, wrote George Sanders thusly... I have added a very standard, very common regex line to my .procmailrc to filter character sets I can't read: UNREADABLE='[^?]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|ks_c_5601|3Deuc-kr

Re: procmail regex help ... sometimes works, sometimes doesn't...

2010-03-29 Thread Mark Shroyer
On 3/29/2010 3:27 AM, p...@pair.com wrote: From: osdeiiftn...@gmail.com xjyfgz...@gmail.com Reply-To: osdeiiftn...@gmail.com xjyfgz...@gmail.com Message-ID: 533pbxxy2oc To: me m...@me.com Subject: Fw:

procmail regex help ... sometimes works, sometimes doesn't...

2010-03-28 Thread George Sanders
I have added a very standard, very common regex line to my .procmailrc to filter character sets I can't read: UNREADABLE='[^?]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|ks_c_5601|3Deuc-kr|koi8' :0: * ^Content-Type:.*multipart * B ?? $ ^Content-Type:.*^?.*charset=?($UNREADABLE

Re: procmail regex help ... sometimes works, sometimes doesn't...

2010-03-28 Thread Mark Shroyer
On 3/28/2010 6:34 PM, George Sanders wrote: I have added a very standard, very common regex line to my .procmailrc to filter character sets I can't read: UNREADABLE='[^?]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987|ks_c_5601|3Deuc-kr|koi8' :0: * ^Content-Type:.*multipart * B

Need some regex help - Guru's?

2010-03-28 Thread itbs
Case in point regarding the server. Please cc me as I'm not subscribed via this account, and I can't receive for the same reason I can't send- damn Yahoo! If anyone can help though it would be much appreciated- on both the regex or the yahoo problem :) Cheers Need_some_regex_help_

Re: using split, can i break up a huge txt file using a regex

2009-10-18 Thread Polytropon
On Fri, 16 Oct 2009 22:25:13 -0700, Gary Kline kl...@thought.org wrote: I would like to put back the huge text file into its 66 smaller files using split. Can I break this very large journeyTowardtheDawn.txt using the regex Chapter [:digit:]{1,2} ?? Or maybe just

using split, can i break up a huge txt file using a regex

2009-10-16 Thread Gary Kline
would like to put back the huge text file into its 66 smaller files using split. Can I break this very large journeyTowardtheDawn.txt using the regex Chapter [:digit:]{1,2} ?? Or maybe just Chapter ? thanks for ideas, gary -- Gary

Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread Drew Tomlinson
I'm trying to do a search and replace in vim. I have lines like this: http://site1/dir/; http://site2/dir/;LastName, FirstName;Phone; http://site3/dir/;LastName, FirstName; http://site4/dir/; I'm want to match http:* and stop matching at the first ;. My basic regex is: /http:.\+;/ But it's

Re: Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread Daniel Bye
matching at the first ;. My basic regex is: /http:.\+;/ But it's matching *all* the semi-colons. Thus I've Googled and tried various incatations to try and make my regex non-greedy but I can't seem to come up with the correct combination. How can I write a regex that stops matching

Re: Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread Mel Flynn
matching at the first ;. My basic regex is: /http:.\+;/ But it's matching *all* the semi-colons. Thus I've Googled and tried various incatations to try and make my regex non-greedy but I can't seem to come up with the correct combination. How can I write a regex that stops matching

Re: Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread Drew Tomlinson
to match http:* and stop matching at the first ;. My basic regex is: /http:.\+;/ But it's matching *all* the semi-colons. Thus I've Googled and tried various incatations to try and make my regex non-greedy but I can't seem to come up with the correct combination. How can I write a regex

Re: Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread Drew Tomlinson
/dir/; I'm want to match http:* and stop matching at the first ;. My basic regex is: /http:.\+;/ But it's matching *all* the semi-colons. Thus I've Googled and tried various incatations to try and make my regex non-greedy but I can't seem to come up with the correct combination. How can I

Re: Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread Bob Hall
matching at the first ;. My basic regex is: /http:.\+;/ Use {-} in place of +. /http:.\{-};/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail

Re: Regex Help - Greedy vs. Non-Greedy

2009-09-09 Thread George Davidovich
matching at the first ;. My basic regex is: /http:.\+;/ But it's matching *all* the semi-colons. Thus I've Googled and tried various incatations to try and make my regex non-greedy but I can't seem to come up with the correct combination. LOL. Do yourself a favour and stop Googling

RegEx

2009-06-05 Thread Grant Peel
Hi all, Does anyone know of a current mailing list that discusses regular expressions? I have Googled a number of time, but everything I find is old. Specifically, I am looking for a modification to this per code: #!/usr/local/bin/perl ... my $iframeexp=[\IFRAMEiframe

Re: RegEx

2009-06-05 Thread Lars Eighner
On Fri, 5 Jun 2009, Grant Peel wrote: Hi all, Does anyone know of a current mailing list that discusses regular expressions? No. Well I don't anyway. I have Googled a number of time, but everything I find is old. Sometimes the old stuff is best. If you had googled very much you should

performance problem in regex

2008-10-09 Thread [EMAIL PROTECTED]
Hi all, I've got some performance hit using regex in libc on freebsd 6.3. I've done some test whit the patterns that l7-filter [http://l7-filter.sf.net] use to recognize level 7 internet protocol. For example, with the skypeout pattern, regexec() takes more tha 0.1 sec to do its work

Re: performance problem in regex

2008-10-09 Thread Michel Talon
fulvio_esposito wrote: I've got some performance hit using regex in libc on freebsd 6.3 Knowing that this regex implementation uses an NFA algorithm, while a DFA algorithm should be preferred, this is no big surprise. You can read the following references on the subject: http://swtch.com/~rsc

Re: performance problem in regex

2008-10-09 Thread Ivan Voras
[EMAIL PROTECTED] wrote: Hi all, I've got some performance hit using regex in libc on freebsd 6.3. I've done some test whit the patterns that l7-filter [http://l7-filter.sf.net] use to recognize level 7 internet protocol. For example, with the skypeout pattern, regexec() takes more tha

regex(3) for only C locale

2006-10-04 Thread Perry Hutchison
Where would I find functionality similar to regcomp(3) and friends, without the complexities of supporting multiple locales? I only need the C locale, and would much prefer to avoid the performance and code size costs associated with handling multi-byte characters.

perl regex help request... .

2006-03-22 Thread Gary Kline
clue me in on the perl regex for matching NN plus any/every character following until \n I can't find my regex book, and am not exactly clear if this will work, but if I go back over my files and insert braces around each note (at the page bottom) like: {14

Re: perl regex help request... .

2006-03-22 Thread Andrew Pantyukhin
/A anchor by hand. Maybe not, if somebody can clue me in on the perl regex for matching NN plus any/every character following until \n I can't find my regex book, and am not exactly clear if this will work, but if I go back over my files and insert braces

Converting a Regex into plain text

2006-02-23 Thread Warren Liddell
is there any pkg avilable that'll convert a regex into plain txt ? Presently i dont care if its windows based or FreeBSD based ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe

Re: Converting a Regex into plain text

2006-02-23 Thread Fabian Keil
Warren Liddell [EMAIL PROTECTED] wrote: is there any pkg avilable that'll convert a regex into plain txt ? What do you mean? What would the plain text translation of (div|p)[^]*(id|class)=\(Ad.*|Logo|SidebarAds|Tips|Item)\ be? Fabian -- http://www.fabiankeil.de/ signature.asc Description

Re: Converting a Regex into plain text

2006-02-23 Thread Chuck Swiger
Warren Liddell wrote: is there any pkg avilable that'll convert a regex into plain txt ? No. Most regular expressions cannot be expressed as finite plain text strings, that is why regex is used in the first place. Presently i dont care if its windows based or FreeBSD based Hmm. -- -Chuck

Re: Converting a Regex into plain text

2006-02-23 Thread Warren Liddell
On Thursday 23 February 2006 15:50, Fabian Keil wrote: Warren Liddell [EMAIL PROTECTED] wrote: is there any pkg avilable that'll convert a regex into plain txt ? What do you mean? What would the plain text translation of (div|p)[^]*(id|class)=\(Ad.*|Logo|SidebarAds|Tips|Item

Re: Converting a Regex into plain text

2006-02-23 Thread chip
On 2/23/06, Warren Liddell [EMAIL PROTECTED] wrote: is there any pkg avilable that'll convert a regex into plain txt ? Presently i dont care if its windows based or FreeBSD based ___ freebsd-questions@freebsd.org mailing list http

Re: Converting a Regex into plain text

2006-02-23 Thread Warren Liddell
Take a look at RegEx Coach it has several ways to express what the regex string is doing. It's got lots of other neat tools as well: http://www.weitz.de/regex-coach/ --chip -- Just my $.02, your mileage may vary, batteries not included, etc Thanks, i'll give it a shot

Re: Using regex(3)

2005-06-23 Thread Dmitry Mityugov
On 6/23/05, Olivier Nicole [EMAIL PROTECTED] wrote: Thanks Titus, no, you're misunderstanding regoff_t or printf. I definitely misunderstand printf. Until now I thought that each place holder (%d) was associated with one variable and if the type missmatched, the display could be

Re: Using regex(3)

2005-06-22 Thread Olivier Nicole
I must missunderstand how to use regex(3). To add a bit, running the same program on Linux gives the expected results: regexpr=a(.)c number of substrings=1 return from regexec=0 nmatch=0 p0.so=0 p0.eo=0 p1.so=0 p1.eo=0 p2.so=0 p2.eo=0 p3.so=0 p3.eo=0 return from regexec=0 nmatch=1 p0.so=0 p0.eo

Re: Using regex(3)

2005-06-22 Thread Titus von Boxberg
Olivier Nicole schrieb: Hi, I must missunderstand how to use regex(3). no, you're misunderstanding regoff_t or printf. it's a 64 bit type. thus your printf should read: ret=regexec(preg, string, nmatch, pmatch, 0); printf(return from regexec=%d\nnmatch=%d\np0.so=%lld p0.eo=%lld\np1.so=%lld

Re: Using regex(3)

2005-06-22 Thread Olivier Nicole
Thanks Titus, no, you're misunderstanding regoff_t or printf. I definitely misunderstand printf. Until now I thought that each place holder (%d) was associated with one variable and if the type missmatched, the display could be incorrect. But in that case, printf seems to take 2 successive %d

Using regex(3)

2005-06-21 Thread Olivier Nicole
Hi, I must missunderstand how to use regex(3). From what I read in the man page, pmatch[i].rm_so is the begining of the i-th match in the regular expression and pmatch[i].rm-so is the end. So if I try to match the regex a(.)c on the string abc I should have: pamtch[1].rm_so=1 and pmatch[1

Re: regex replacement wizard advice needed

2004-09-28 Thread Fabian Keil
On Monday 27 September 2004 21:28, Gary Kline wrote: I have a document with numbered paragraphs, the numbers to the far left of each paragraph. Is there a perl s/NNN/BNNN//BBR/g means I can use from the CL or as a script to make this doc more easy (for me) to read. The document is

Re: regex replacement wizard advice needed

2004-09-28 Thread Gary Kline
REGEX book. But Tom Embt's example was right on the money. (FWIW, I've learned to never try to explain to non-nerds what a regular expression is. They give me strange looks!) thanks, gary -- Gary Kline [EMAIL PROTECTED] www.thought.org

Re: regex replacement wizard advice needed

2004-09-28 Thread Gary Kline
/p/li@;print' input.txt; echo /ol/body/html) output.html Without the line breaks, of course. This might be closer, plugging in your ;print and Tom's regex, since the doc is plaintext, maybe ASCII. But then I'll want to put P or BR tags before each (\d+) line

regex replacement wizard advice needed

2004-09-27 Thread Gary Kline
Hi Gang, I have a document with numbered paragraphs, the numbers to the far left of each paragraph. Is there a perl s/NNN/BNNN//BBR/g means I can use from the CL or as a script to make this doc more easy (for me) to read. The document is

Re: regex replacement wizard advice needed

2004-09-27 Thread Atle Veka
How about something like (assuming space between numbering and paragraph is a tab): perl -pi -e 's,^(\d)\t,B$1/BBR,' filename Atle - Flying Crocodile Inc, Unix Systems Administrator ___ [EMAIL PROTECTED] mailing list

Regex with dump/restore not working

2004-08-31 Thread Karl Heller
I'm trying to do something very simple, that is, restore just mp3 files from a set of tapes. However, none of the expressions I'm using will work.. restore -tvNf /dev/nsa1 expression; where epxressions I have tried are *mp3 *.mp3 .*mp3 ^*.mp3 ^*.mp3$ ^.*mp3$ It seems any expression consisting of

grep RegEx Syntax- How to Match?

2004-05-17 Thread Drew Tomlinson
/public/murphys/produced/tricks.html HTTP/1.0 200 5446 - Mozilla/4.77 [en] (X11; U; Linux 2.2.19 i686) I'm using the this command: egrep -e ^123\.456\.789\.123.*htm.* /path/to/file However this does not match anything. If I shorten the regex to ^123\.456\.789\.123, I match all entries

Re: grep RegEx Syntax- How to Match?

2004-05-17 Thread Erik Trulsson
However this does not match anything. If I shorten the regex to ^123\.456\.789\.123, I match all entries with that IP address. And if I use 'htm' as the regex, I get match all lines with html files. But I can't find the right syntax to match on both conditions. You could try piping

Re: grep RegEx Syntax- How to Match? -- SOLVED

2004-05-17 Thread Drew Tomlinson
'*' as a wildcard. I.e. try egrep -e '^123\.456\.789\.123.*htm.*' /path/to/file Thank you! Yes, this works as I expect. However this does not match anything. If I shorten the regex to ^123\.456\.789\.123, I match all entries with that IP address. And if I use 'htm' as the regex, I get match all lines

Re: Off Topic RegEx Question

2003-08-29 Thread mpd
On Thu, Aug 28, 2003 at 08:26:43AM +0900, Roger Williams wrote: I know thins is not the place but I know one of you know this one off the top of your head. I have: $list = dog 1 1 1 cat 2 1 snake 111 and I want to end up with: dog 1 cat 2 snake 1 I thought $list =~ s/ \d \d/ \d/g;

Re: Off Topic Regex Question

2003-08-29 Thread Mikko Työläjärvi
On Thu, 28 Aug 2003, Roger Williams wrote: I know thins is not the place but I know one of you know this one off the top of your head. I have: $list = dog 1 1 1 cat 2 1 snake 111 and I want to end up with: dog 1 cat 2 snake 1 I thought $list =~ s/ \d \d/ \d/g; would do the trick, but

Off Topic RegEx Question

2003-08-28 Thread Roger Williams
I know thins is not the place but I know one of you know this one off the top of your head. I have: $list = dog 1 1 1 cat 2 1 snake 111 and I want to end up with: dog 1 cat 2 snake 1 I thought $list =~ s/ \d \d/ \d/g; would do the trick, but that gives me: dog d 1 1 cat d snake d 1 Thanks,

Re: Off Topic RegEx Question

2003-08-28 Thread David Landgren
Roger Williams wrote: I know thins is not the place but I know one of you know this one off the top of your head. I have: $list = dog 1 1 1 cat 2 1 snake 111 and I want to end up with: dog 1 cat 2 snake 1 I thought $list =~ s/ \d \d/ \d/g; would do the trick, but that gives me: dog d 1

Off Topic RegEx Question

2003-08-28 Thread Roger Williams
I know thins is not the place but I know one of you know this one off the top of your head. I have: $list = dog 1 1 1 cat 2 1 snake 111 and I want to end up with: dog 1 cat 2 snake 1 I thought $list =~ s/ \d \d/ \d/g; would do the trick, but that gives me: dog d 1 1 cat d snake d 1 Thanks,

Off Topic Regex Question

2003-08-28 Thread Roger Williams
I know thins is not the place but I know one of you know this one off the top of your head. I have: $list = dog 1 1 1 cat 2 1 snake 111 and I want to end up with: dog 1 cat 2 snake 1 I thought $list =~ s/ \d \d/ \d/g; would do the trick, but that gives me: dog d 1 1 cat d snake d 1 Thanks,

Default Quotas and Regex Searches

2002-11-24 Thread Grant Peel
Hi all, A while back I set something somewhere so that when I add a new user, the OS (FreeBSD 4.4) sets a default user quota for that new user. I have since decided to give users more space, but can;t remember where I set up the default *sigh*. Does anyone know where new user default quotas

OT: regex(3) and POSIX collating sequences

2002-10-22 Thread D J Hawkey Jr
Hi. This is rather off-topic, but as the trouble I'm having is on a FreeBSD box, I'm hoping you'll excuse me. What's up with collating sequences and the regcomp(3) function? From the re_format(7) man page: Within a bracket expression, a collating element (a character, a multi-