dcdev mailing list

Direct Connect developers, 2003 to 2005
← All threads

On regex'es...

8 messages · Todd Pederzani, Fredrik Tolf, blackclaw@parsoma.net, Daniel Muller, Jacek Sieka
23 January 2004, 03:12Todd Pederzani <todd.pederzani@verizon.net>
to Direct Connect developers

blackclaw@parsoma.net wrote:

Okay, how about http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm, then: "This version supports the full POSIX syntax including multi-character collating elements and equivalence classes, as well as some of Perl's features like non-greedy repeats, forward lookahead asserts, and non-marking parenthesis."

It's part of the Boost C++ library.


Boost seems to have different segment under different licenses?  From what I've heard you (and others) say about boost, using it is probably a good thing.

The license seems fine too:

Copyright (c) 1998-2000
Dr John Maddock

Permission to use, copy, modify, distribute and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation.  Dr John Maddock makes no representations
about the suitability of this software for any purpose.  It is provided "as is" without express or implied warranty.

Footnotes:
1) Localised versions may translate the above notice into the native
  language of the version.
2) The above notice applies to source code and documentation, users
  who are distributing only binary forms, need only indicate, somewhere
  in their documentation or in their help|about notice that the product
  uses this library and that the copyright is Dr John Maddock 1998-2000


- Todd
23 January 2004, 03:46Fredrik Tolf <fredrik@dolda2000.com>
to Direct Connect developers
Jacek Sieka writes:
> So, all of you regex freaks out there, which regex library to use?
> There's a plethora of them out there, all with (slightly) different
> syntax...obviously, in the end, it would be useful for all clients
> that support regex to support the same regex?

While I do like perl regexes (of course...), I'd say that POSIX
extended regexes probably is the best option. I say that because it is
a specified standard, and thus, unlike perl REs, it doesn't lock you
to a specific implementation, but there are several to choose
from. For example, I'm fairly sure that the "RX" package from
gnuwin32.sf.net implements POSIX extended REs. It's also the standard
behavior of glibc on GNU systems (provided that you give the
REG_EXTENDED flag). POSIX extended REs also do contain almost all
features you'd ever want.

If you want to review it, its syntax is given in the regex(7)
manpage. For those of you on a Windows system, I have made it
available in HTML format here:
http://www.dolda2000.com/~fredrik/doldaconnect/regex.7.html

Also, if you want the most commonly used stuff from the perl-style
REs (like \s and \w and so on), it's fairly easy to make the client
translate it into bracket expressions.

Fredrik Tolf

23 January 2004, 04:06blackclaw@parsoma.net
to Direct Connect developers

At 03:46 AM 1/23/2004 +0100, you wrote:
While I do like perl regexes (of course...), I'd say that POSIX
extended regexes probably is the best option. I say that because it is
a specified standard, and thus, unlike perl REs, it doesn't lock you
to a specific implementation, but there are several to choose
from. For example, I'm fairly sure that the "RX" package from
gnuwin32.sf.net implements POSIX extended REs. It's also the standard
behavior of glibc on GNU systems (provided that you give the
REG_EXTENDED flag). POSIX extended REs also do contain almost all
features you'd ever want.

Among regex flavors, I prefer that Perl5 one as well. There are several available implementations, too:

Java: http://jregex.sourceforge.net/
Win32 C: http://www.psyon.org/projects/pcre-win32/, http://gnuwin32.sourceforge.net/packages/pcre.htm
Win32 C++: http://research.microsoft.com/projects/greta/
Python: http://python.org/doc/2.3.3/lib/re-syntax.html

More, probably, but that's whay I found in a few minutes.

-cologic
23 January 2004, 04:10Fredrik Tolf <fredrik@dolda2000.com>
to Direct Connect developers
blackclaw@parsoma.net writes:
> At 03:46 AM 1/23/2004 +0100, you wrote:
> Among regex flavors, I prefer that Perl5 one as well. There are several > available implementations, too:
> > [...]
> > More, probably, but that's whay I found in a few minutes.

I see; I just assumed the PCREs was more or less only found in the
perl libraries. Now if this is the case, I would certainly like to
suggest Perl-style REs instead.

Fredrik Tolf

23 January 2004, 04:40Todd Pederzani <todd.pederzani@verizon.net>
to Direct Connect developers

blackclaw@parsoma.net wrote:

Win32 C++: http://research.microsoft.com/projects/greta/

As an aside, Greta's license (despite being included in fulDC) isn't suitable for any DC client I know of:

GRETA 2.6.4

This Microsoft Research end user license agreement ("MSR-EULA") is a legal agreement between you and Microsoft Corporation (“Microsoft� or “we�) for the software identified above and any associated materials, which includes any associated media and "online" or electronic documentation and may include source code (together, the "Software").

By installing, copying, or otherwise using the Software, found at http://research.microsoft.com/downloads, you agree to be bound by the terms of this MSR-EULA. If you do not agree, do not install, copy or use the Software. The Software is protected by copyright and other intellectual property laws and is licensed, not sold.

If Software is in object code:

*Upon your agreement to the terms below, you may install one copy of the Software on your personal computer and use such copy at no charge for your non-commercial research or non-commercial teaching purposes, only in an academic or other noncommercial research setting. In return, we ask that you agree to the following:
* NO TRANSFER RIGHTS: That you will not copy, sell, rent, lease, distribute, sublicense, assign, or otherwise transfer (including by loan or gift) the Software and will not attempt to modify it, or to reverse engineer or decompile it, except and only to the extent authorized.
* To leave in place all copyright notices and licensing information that you might find in the Software.
* That you will not use the Software in a live operating environment where it may be relied upon to perform in the same manner as a commercially released product, or with data that has not been sufficiently backed up.
* That any feedback about the Software provided by you to us is voluntarily given, and Microsoft shall be free to use the feedback as it sees fit without obligation or restriction of any kind, even if the feedback is designated by you as confidential.
* NO WARRANTIES WHATSOEVER: That the Software comes “AS IS�, with all faults and with no warranties, conditions or representations. The implied warranties of merchantability and fitness for a particular purpose, and any warranty against interference with your enjoyment of the Software or against infringement, do not apply to the Software. The entire risk as to satisfactory quality, performance, accuracy, and effort concerning the Software is assumed by you. There is no warranty that this Software will fulfill any of your particular purposes or needs.
* That we have no duty of reasonable care or lack of negligence, and we are not obligated to (and will not) provide technical support for the Software.
* That we will not be liable for any damages, including those known as direct, indirect, special, consequential, or incidental damages related to the Software, this MSR-EULA, or under any legal theory (such as negligence), to the maximum extent that overriding applicable law permits.
* That if you sue or threaten to sue anyone over patents that you think may apply to the Software, or if you breach this MSR-EULA in any way, your license to the Software ends automatically.
* That this MSR-EULA shall be construed and controlled by the laws of the State of Washington, USA, without regard to conflicts of law.

If Software is in source code, these additional rights and restrictions apply:

*You may do anything you want with the Software source code for non-commercial research or non-commercial teaching purposes free of charge, provided that you agree to the following:
*To make freely available to others the source code of any modifications or additions you make to the Software source code, and any related documentation, solely and exclusively under the same terms as this License.
* That Microsoft is granted back, without limitations, the rights to reproduce, install, use, modify, distribute and transfer your source modifications or additions in source and/or object code formats.

Copyright (c) Microsoft Corporation. All rights reserved


Specifically, most DC clients do not (honestly) fit into the "non-commercial research" or "non-commercial teaching" categories.

- Todd
23 January 2004, 06:30blackclaw@parsoma.net
to Direct Connect developers

At 10:40 PM 1/22/2004 -0500, you wrote:
blackclaw@parsoma.net wrote:

Win32 C++: http://research.microsoft.com/projects/greta/

As an aside, Greta's license (despite being included in fulDC) isn't suitable for any DC client I know of:

Okay, how about http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm, then: "This version supports the full POSIX syntax including multi-character collating elements and equivalence classes, as well as some of Perl's features like non-greedy repeats, forward lookahead asserts, and non-marking parenthesis."

It's part of the Boost C++ library.

-cologic
23 January 2004, 09:40Daniel Muller <dan@verliba.cz>
to Direct Connect developers
And what about pcre ??

On Fri, 23 Jan 2004 blackclaw@parsoma.net wrote:

At 10:40 PM 1/22/2004 -0500, you wrote:
>blackclaw@parsoma.net wrote:
>
>>Win32 C++: http://research.microsoft.com/projects/greta/
>
>As an aside, Greta's license (despite being included in fulDC) isn't
>suitable for any DC client I know of:

Okay, how about
http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm, then:
"This version supports the full POSIX syntax including multi-character
collating elements and equivalence classes, as well as some of Perl's
features like non-greedy repeats, forward lookahead asserts, and
non-marking parenthesis."

It's part of the Boost C++ library.

-cologic

23 January 2004, 12:20Jacek Sieka <j_s@telia.com>
to "'Direct Connect developers'" <dcdev@dcportal.net>
So, all of you regex freaks out there, which regex library to use? There's a
plethora of them out there, all with (slightly) different
syntax...obviously, in the end, it would be useful for all clients that
support regex to support the same regex?

And I would appreciate an answer with some research backing it, not just the
average "linux-is-best-and-I-know-5-commands-in-it-so-I-am-best"-answer that
characterises most people who zealously lock on one os...

/J