Re: Regular Expression Editor

2010-01-15 Thread Matthew Seaman

Carmel wrote:

On Thu, 14 Jan 2010 10:38:41 -0800
Randal L. Schwartz mer...@stonehenge.com replied:


You need to be specific about the kind of regex.  While most regexp
engines have common things like . and * and ^ and $, the meanings may
vary a bit, and the more exotic things are certainly going to vary.

(For example, despite the name, Perl Compatible [sic] Regular
Expressions are *not* Perl compatible.)

What tool are you using your regexes with?


OK, I was using RegExp Buddy http://www.regexbuddy.com/ on a Windows
machine. I would like to find something similar to it for a FreeBSD
environment. The expressions I create are used primarily with 'sieve'
in conjunction with Dovecot. I am also thinking of possibly creating a
few for use with Postfix.



I believe dovecot simply uses the standard posix 'extended regular
expression' syntax as seen in programs like grep(1).  [See: http://ietfreport.isoc.org/idref/draft-ietf-sieve-regex ] 


In principle, this means you can write your test data into a file, and
test it by running it through grep(1) using the -E flag:

  grep -E 'foo@(bar|baz)\.org'  testdata.txt

Postfix uses PCRE by default. You can do the same sort of trick there:
just run 'pcregrep' rather than 'grep -E'

However, note that the regexes in dovecot sieve scripts are subject to
a level of shell expansion. (Not sure what happens with postfix.) This
means various special characters are going to need to be escaped by
preceding them with a *pair* of backslashes.  So, in the example above,
the bit that says '\.' (meaning override the usual meaning of '.' as a
wildcard that will match any character, and instead match a literal '.')
would have to be entered into  your sieve script as '\\\.'  If in doubt,
simply pound on the backslash key a few more times...

Cheers,

Matthew


--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Regular Expression Editor

2010-01-15 Thread Randal L. Schwartz
 Chad == Chad Perrin per...@apotheon.com writes:

Chad I don't know if I've just overlooked your presence before, or if this is
Chad actually the first time I've seen a comment from you on this mailing
Chad list, but hi, Randal.

It might be the first or second comment.  I'm a new FreeBSD user.  I've
been talking about my experiences in the intro/outros of recent FLOSS Weekly
episodes (http://twit.tv/floss) if you want details.

Chad I think you must have overlooked the part where Carmel mentioned writing
Chad regexen for use with sieve+Dovecot and possibly with Postfix.

That wasn't in the initial message that I recall.  But if that was already
clear, I apologize for repeating my question.

-- 
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, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Regular Expression Editor

2010-01-14 Thread Carmel
I am looking for a RegExp editor. I have one that I have used under
Windows; however, it will not obviously work on FreeBSD. What I need is
one that I can write the expression in and then have it test the
expression for both syntax and against example text that I enter. I
have not been able to locate a FOSS solution for that although there are
numerous commercial products available.

--
Carmel
carmel...@hotmail.com

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Randal L. Schwartz
 Carmel == Carmel  carmel...@hotmail.com writes:

Carmel I am looking for a RegExp editor. I have one that I have used under
Carmel Windows; however, it will not obviously work on FreeBSD. What I need is
Carmel one that I can write the expression in and then have it test the
Carmel expression for both syntax and against example text that I enter. I
Carmel have not been able to locate a FOSS solution for that although there are
Carmel numerous commercial products available.

You need to be specific about the kind of regex.  While most regexp engines
have common things like . and * and ^ and $, the meanings may vary a bit, and
the more exotic things are certainly going to vary.

(For example, despite the name, Perl Compatible [sic] Regular Expressions
are *not* Perl compatible.)

What tool are you using your regexes with?

-- 
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, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Carmel
On Thu, 14 Jan 2010 10:38:41 -0800
Randal L. Schwartz mer...@stonehenge.com replied:

You need to be specific about the kind of regex.  While most regexp
engines have common things like . and * and ^ and $, the meanings may
vary a bit, and the more exotic things are certainly going to vary.

(For example, despite the name, Perl Compatible [sic] Regular
Expressions are *not* Perl compatible.)

What tool are you using your regexes with?

OK, I was using RegExp Buddy http://www.regexbuddy.com/ on a Windows
machine. I would like to find something similar to it for a FreeBSD
environment. The expressions I create are used primarily with 'sieve'
in conjunction with Dovecot. I am also thinking of possibly creating a
few for use with Postfix.

-- 
Jerry
ges...@yahoo.com

|===
|===
|===
|===
|

Do not try to solve all life's problems at once --
learn to dread each day as it comes.


Donald Kaul

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Dan Nelson
In the last episode (Jan 14), Carmel said:
 On Thu, 14 Jan 2010 10:38:41 -0800
 Randal L. Schwartz mer...@stonehenge.com replied:
 
 You need to be specific about the kind of regex.  While most regexp
 engines have common things like . and * and ^ and $, the meanings may
 vary a bit, and the more exotic things are certainly going to vary.
 
 (For example, despite the name, Perl Compatible [sic] Regular
 Expressions are *not* Perl compatible.)
 
 What tool are you using your regexes with?
 
 OK, I was using RegExp Buddy http://www.regexbuddy.com/ on a Windows
 machine.  I would like to find something similar to it for a FreeBSD
 environment.  The expressions I create are used primarily with 'sieve' in
 conjunction with Dovecot.  I am also thinking of possibly creating a few
 for use with Postfix.

Have you tried running regexbuddy under Wine?  For a small program like that
it should work pretty well.

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Carmel
On Thu, 14 Jan 2010 15:22:13 -0600
Dan Nelson dnel...@allantgroup.com articulated:

Have you tried running regexbuddy under Wine?  For a small program
like that it should work pretty well.

I have no desire to use 'wine'. It would probably be a lot easier and
simpler to simply use it on the Windows machine. I had thought that
since RegExp are probably more commonly used on non-win32 machines that
I would be able to locate a similar FOSS.

Thanks anyway!

--
Carmel
carmel...@hotmail.com

|===
|===
|===
|===
|

Eating chocolate is like being in love without the aggravation.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Greg Larkin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carmel wrote:
 On Thu, 14 Jan 2010 15:22:13 -0600
 Dan Nelson dnel...@allantgroup.com articulated:
 
 Have you tried running regexbuddy under Wine?  For a small program
 like that it should work pretty well.
 
 I have no desire to use 'wine'. It would probably be a lot easier and
 simpler to simply use it on the Windows machine. I had thought that
 since RegExp are probably more commonly used on non-win32 machines that
 I would be able to locate a similar FOSS.
 
 Thanks anyway!
 

Hi Carmel,

How about Regex Coach? http://weitz.de/regex-coach/#older

The older version (0.9.0) runs under Linux and FreeBSD, but the author
has discontinued support for non-Windows platforms in the latest version.

The old one may still be useful, and you get bonus points if you write a
port for it!

Cheers,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/   - The Power To Serve
http://www.sourcehosting.net/ - Ready. Set. Code.
http://twitter.com/sourcehosting/ - Follow me, follow you
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFLT5MF0sRouByUApARAvMdAJ9//xAI6e5NQOKe+yHZlHs+DQZDZwCghB4V
ukUemVKBb0J5Go5prqiG7IQ=
=mdN9
-END PGP SIGNATURE-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread RW
On Thu, 14 Jan 2010 14:24:49 -0500
Carmel carmel...@hotmail.com wrote:

 On Thu, 14 Jan 2010 10:38:41 -0800
 Randal L. Schwartz mer...@stonehenge.com replied:
 
 You need to be specific about the kind of regex.  While most regexp
 engines have common things like . and * and ^ and $, the meanings may
 vary a bit, and the more exotic things are certainly going to vary.
 
 (For example, despite the name, Perl Compatible [sic] Regular
 Expressions are *not* Perl compatible.)
 
 What tool are you using your regexes with?
 
 OK, I was using RegExp Buddy http://www.regexbuddy.com/ on a Windows
 machine. I would like to find something similar to it for a FreeBSD
 environment. The expressions I create are used primarily with 'sieve'
 in conjunction with Dovecot. I am also thinking of possibly creating a
 few for use with Postfix.
 

Try this 

http://www.fastmail.fm/docs/sieve/sievetest.php

It's based on Cyrus but AFAIK they both use the libc regex
implementation.

Sieve is a little odd in that you need double escaping

In general I think most people would use command line tools to test
expressions.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread earscrew
Carmel wrote:
 I am looking for a RegExp editor. I have one that I have used under
 Windows; however, it will not obviously work on FreeBSD. What I need is
 one that I can write the expression in and then have it test the
 expression for both syntax and against example text that I enter. I
 have not been able to locate a FOSS solution for that although there are
 numerous commercial products available.
 
 --
 Carmel
 carmel...@hotmail.com
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
 

If you run Firefox, this addon is decent:

https://addons.mozilla.org/en-US/firefox/addon/2077
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Olivier Nicole
 In general I think most people would use command line tools to test
 expressions.

Although I favor command line tools for most of my work (if only,
because it can work remotely, through a slow phone connection, across
the world); I like The Regex Coach (GUI tool) because it highlights
the various strings and substrings matched.

Also I like it because the regex (as far as I have used it) have the
exact syntax of Perl, so it is just a matter of cut  paste: usefull
to find a mistake in a long and intricated regex.

Bests,

Olivier
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Andrew Brampton
2010/1/14 Carmel carmel...@hotmail.com:

 I am looking for a RegExp editor. I have one that I have used under
 Windows; however, it will not obviously work on FreeBSD. What I need is
 one that I can write the expression in and then have it test the
 expression for both syntax and against example text that I enter. I
 have not been able to locate a FOSS solution for that although there are
 numerous commercial products available.


I've enjoying using Kodos[1] in the past.

Andrew

[1] http://kodos.sourceforge.net/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Randal L. Schwartz
 Carmel == Carmel  carmel...@hotmail.com writes:

 What tool are you using your regexes with?

Carmel OK, I was using RegExp Buddy http://www.regexbuddy.com/ on a Windows
Carmel machine.

Nice non-answer.  I'm sorry I wasn't clear.

What *thing* will these regexs eventually be used in?  PHP?  Perl?
Awk?  Sed?  Java?

-- 
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, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Regular Expression Editor

2010-01-14 Thread Chad Perrin
On Thu, Jan 14, 2010 at 06:50:59PM -0800, Randal L. Schwartz wrote:
  Carmel == Carmel  carmel...@hotmail.com writes:
 
  What tool are you using your regexes with?
 
 Carmel OK, I was using RegExp Buddy http://www.regexbuddy.com/ on a Windows
 Carmel machine.
 
 Nice non-answer.  I'm sorry I wasn't clear.
 
 What *thing* will these regexs eventually be used in?  PHP?  Perl?
 Awk?  Sed?  Java?

I don't know if I've just overlooked your presence before, or if this is
actually the first time I've seen a comment from you on this mailing
list, but hi, Randal.

Okay, that aside:

I think you must have overlooked the part where Carmel mentioned writing
regexen for use with sieve+Dovecot and possibly with Postfix.  I get the
impression from that and later comments in the thread that Carmel is
particularly focused on sieve's regex syntax, which may use libc's regex
implementation.

-- 
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]


pgpQLPctP5cuG.pgp
Description: PGP signature