You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2015/02/01 17:38:19 UTC

Re: Anyone interested in regular expressions, again?

I think we'll need some clear performance advantages documented as well as
any compatibility issues.

This begs for a facade API IMO. I would not want to recode my app just to
test one vs. the other, it should be pluggable.

Gary

On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <bi...@gmail.com>
wrote:

> So, once upon a time, there was a regex library here. It was retired,
> presumably on the grounds that it was rendered obsolete by the JRE's
> native support.
>
> However, the JRE's regular expressions have a pretty severe problem;
> they have unbounded (or at least, very, very, bad) execution time for
> some combinations of data and regex.
>
> To cope with this, we ported the Henry Spencer regular expression
> library (as found in TCL) from C to Java.
>
> Thus: https://github.com/basis-technology-corp/tcl-regex-java
>
> Is anyone interested in this? Give or take the possible IP muddle of
> the original C Code, I could grant it easily.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Anyone interested in regular expressions, again?

Posted by Ben McCann <be...@benmccann.com>.
That's be awesome James. I'd love to see re2j out in the open

On Mon, Feb 2, 2015 at 2:20 PM, James Ring <sj...@jdns.org> wrote:

> I spoke to one of the authors of re2j, a Google-internal port of the C++
> re2 library. The intention was to open source it but they just haven't got
> around to it.
>
> I may try and get Google to put re2j up on GitHub so you all can take a
> look. AFAIK it is heavily used in Google and it has an API that is largely
> compatible with java.util.regex. I know from personal experience that one
> can often benefit from re2j merely by replacing java.util.regex imports
> with the corresponding re2j imports.
>
> Regards,
> James
> On Feb 1, 2015 11:44 PM, "Thomas Neidhart" <th...@gmail.com>
> wrote:
>
> > On 02/02/2015 03:25 AM, sebb wrote:
> > > I would not wish to move away from Java RE *unless* the RE syntax was
> > > the same *and* the implementation was better performing *and* the
> > > existing code suffered from poor performance.
> > >
> > > It might be OK if the alternate implementation was missing some
> > > esoteric features, but I would be very wary of using any features that
> > > were not in the Java implementation.
> > >
> > > The likelihood is that the Java implementation will (eventually)
> > > become more performant, at which point it would be useful to be able
> > > to revert to the Java version.
> > > That requires a high degree of compatibilty to reduce the work
> involved.
> > >
> > > It might be more useful to produce a tool that detects inefficient RE
> > > usage and suggests improvements.
> >
> > I just know re2 a bit, but it is a trade-off:
> >
> >  * linear-time evaluation vs. some features (e.g. backreferences)
> >
> > A comparison between different regular expression implementations can be
> > found here:
> >
> > http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines
> >
> > I am pretty sure the regexp implementation in java will not change,
> > simply because of backwards compatibility reasons, but such a library
> > would be useful as in many cases you do not need these additional
> > features but want to ensure that your regular expression will be
> > evaluated in linear time.
> >
> > Thomas
> >
> > >
> > >
> > > On 1 February 2015 at 22:35, James Carman <ja...@carmanconsulting.com>
> > wrote:
> > >> To be clear, I am not advocating this approach.  I was merely trying
> to
> > >> illustrate what a nightmare such an endeavor would be. :)
> > >>
> > >> On Sunday, February 1, 2015, James Carman <james@carmanconsulting.com
> >
> > >> wrote:
> > >>
> > >>> You would basically have to pick a canonical regex language if you
> > want a
> > >>> facade and be able to swap the regex library out.  Most of them are
> > very
> > >>> similar but they are not the same.
> > >>>
> > >>> On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
> > >>> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
> > >>>
> > >>>> I think we'll need some clear performance advantages documented as
> > well as
> > >>>> any compatibility issues.
> > >>>>
> > >>>> This begs for a facade API IMO. I would not want to recode my app
> > just to
> > >>>> test one vs. the other, it should be pluggable.
> > >>>>
> > >>>> Gary
> > >>>>
> > >>>> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <
> > bimargulies@gmail.com
> > >>>>>
> > >>>> wrote:
> > >>>>
> > >>>>> So, once upon a time, there was a regex library here. It was
> retired,
> > >>>>> presumably on the grounds that it was rendered obsolete by the
> JRE's
> > >>>>> native support.
> > >>>>>
> > >>>>> However, the JRE's regular expressions have a pretty severe
> problem;
> > >>>>> they have unbounded (or at least, very, very, bad) execution time
> for
> > >>>>> some combinations of data and regex.
> > >>>>>
> > >>>>> To cope with this, we ported the Henry Spencer regular expression
> > >>>>> library (as found in TCL) from C to Java.
> > >>>>>
> > >>>>> Thus: https://github.com/basis-technology-corp/tcl-regex-java
> > >>>>>
> > >>>>> Is anyone interested in this? Give or take the possible IP muddle
> of
> > >>>>> the original C Code, I could grant it easily.
> > >>>>>
> > >>>>>
> ---------------------------------------------------------------------
> > >>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > >>>>> For additional commands, e-mail: dev-help@commons.apache.org
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>
> > >>>> --
> > >>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > >>>> Java Persistence with Hibernate, Second Edition
> > >>>> <http://www.manning.com/bauer3/>
> > >>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > >>>> Spring Batch in Action <http://www.manning.com/templier/>
> > >>>> Blog: http://garygregory.wordpress.com
> > >>>> Home: http://garygregory.com/
> > >>>> Tweet! http://twitter.com/GaryGregory
> > >>>>
> > >>>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: dev-help@commons.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>



-- 
about.me/benmccann

Re: Anyone interested in regular expressions, again?

Posted by "Bruno P. Kinoshita" <br...@yahoo.com.br>.
Someone posted to Hacker News too. Here's the link to the comments there https://news.ycombinator.com/item?id=9070593

CheersBruno

 
      From: Benson Margulies <bi...@gmail.com>
 To: Commons Developers List <de...@commons.apache.org>; Bruno P. Kinoshita <br...@yahoo.com.br> 
 Sent: Tuesday, February 17, 2015 11:53 PM
 Subject: Re: Anyone interested in regular expressions, again?
   
Thanks! I look forward to retiring mine!

On Tue, Feb 17, 2015 at 8:48 PM, Bruno P. Kinoshita
<br...@yahoo.com.br> wrote:
> That's great news! Thanks James!
> Bruno
>
>      From: James Ring <sj...@jdns.org>
>  To: Commons Developers List <de...@commons.apache.org>
>  Sent: Tuesday, February 17, 2015 11:31 PM
>  Subject: Re: Anyone interested in regular expressions, again?
>
> Hey Benson,
>
> Just wanted to let you and the rest of the commons dev list that re2j
> is now in the open: please see https://github.com/google/re2j. Please
> take a look!
>
> Regards,
> James
>
> On Mon, Feb 9, 2015 at 12:16 PM, Benson Margulies <bi...@gmail.com> wrote:
>> On Mon, Feb 9, 2015 at 1:36 PM, James Ring <sj...@jdns.org> wrote:
>>> I'm working to bring re2j into the open, it will take some time
>>> because Google's internal procedures for this kind of thing are pretty
>>> lengthy. I'm hopeful it could be done in the next month or so.
>>
>> That is lovely news. Thanks!
>>
>>>
>>> On Tue, Feb 3, 2015 at 12:14 PM, Benson Margulies <bi...@gmail.com> wrote:
>>>> On Tue, Feb 3, 2015 at 2:39 AM, Thomas Neidhart
>>>> <th...@gmail.com> wrote:
>>>>> On 02/03/2015 01:46 AM, Benson Margulies wrote:
>>>>>> The irony here is that the Java HSRE port happened because it seemed
>>>>>> easier than an RE2 port. Note the same statements about API's pretty
>>>>>> much apply.
>>>>>
>>>>> I am sorry, my response was not very sensible wrt your original proposal.
>>>>
>>>> It seems very sensible to me. A team at Google producing re2j is
>>>> likely to have produced a far superior comestible to what I did. If
>>>> there's any possibility that it will emerge in, oh, a month or two, I
>>>> don't think it makes sense to go to the trouble to pull the HSRE code
>>>> into Apache.
>>>>
>>>>>
>>>>> If we have another implementation that works fine and has a sufficiently
>>>>> large enough community then I do not see a problem to include it in the
>>>>> commons project, I would certainly be interested.
>>>>>
>>>>> Thomas
>>>>>
>>>>>> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
>>>>>> <th...@gmail.com> wrote:
>>>>>>> On 02/02/2015 11:20 PM, James Ring wrote:
>>>>>>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>>>>>>> re2 library. The intention was to open source it but they just haven't got
>>>>>>>> around to it.
>>>>>>>>
>>>>>>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>>>>>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>>>>>>> compatible with java.util.regex. I know from personal experience that one
>>>>>>>> can often benefit from re2j merely by replacing java.util.regex imports
>>>>>>>> with the corresponding re2j imports.
>>>>>>>
>>>>>>> that would be super-cool.
>>>>>>>
>>>>>>> Thomas
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>>> For additional commands, e-mail: dev-help@commons.apache.org


>
>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org



   

Re: Anyone interested in regular expressions, again?

Posted by Benson Margulies <bi...@gmail.com>.
Thanks! I look forward to retiring mine!

On Tue, Feb 17, 2015 at 8:48 PM, Bruno P. Kinoshita
<br...@yahoo.com.br> wrote:
> That's great news! Thanks James!
> Bruno
>
>       From: James Ring <sj...@jdns.org>
>  To: Commons Developers List <de...@commons.apache.org>
>  Sent: Tuesday, February 17, 2015 11:31 PM
>  Subject: Re: Anyone interested in regular expressions, again?
>
> Hey Benson,
>
> Just wanted to let you and the rest of the commons dev list that re2j
> is now in the open: please see https://github.com/google/re2j. Please
> take a look!
>
> Regards,
> James
>
> On Mon, Feb 9, 2015 at 12:16 PM, Benson Margulies <bi...@gmail.com> wrote:
>> On Mon, Feb 9, 2015 at 1:36 PM, James Ring <sj...@jdns.org> wrote:
>>> I'm working to bring re2j into the open, it will take some time
>>> because Google's internal procedures for this kind of thing are pretty
>>> lengthy. I'm hopeful it could be done in the next month or so.
>>
>> That is lovely news. Thanks!
>>
>>>
>>> On Tue, Feb 3, 2015 at 12:14 PM, Benson Margulies <bi...@gmail.com> wrote:
>>>> On Tue, Feb 3, 2015 at 2:39 AM, Thomas Neidhart
>>>> <th...@gmail.com> wrote:
>>>>> On 02/03/2015 01:46 AM, Benson Margulies wrote:
>>>>>> The irony here is that the Java HSRE port happened because it seemed
>>>>>> easier than an RE2 port. Note the same statements about API's pretty
>>>>>> much apply.
>>>>>
>>>>> I am sorry, my response was not very sensible wrt your original proposal.
>>>>
>>>> It seems very sensible to me. A team at Google producing re2j is
>>>> likely to have produced a far superior comestible to what I did. If
>>>> there's any possibility that it will emerge in, oh, a month or two, I
>>>> don't think it makes sense to go to the trouble to pull the HSRE code
>>>> into Apache.
>>>>
>>>>>
>>>>> If we have another implementation that works fine and has a sufficiently
>>>>> large enough community then I do not see a problem to include it in the
>>>>> commons project, I would certainly be interested.
>>>>>
>>>>> Thomas
>>>>>
>>>>>> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
>>>>>> <th...@gmail.com> wrote:
>>>>>>> On 02/02/2015 11:20 PM, James Ring wrote:
>>>>>>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>>>>>>> re2 library. The intention was to open source it but they just haven't got
>>>>>>>> around to it.
>>>>>>>>
>>>>>>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>>>>>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>>>>>>> compatible with java.util.regex. I know from personal experience that one
>>>>>>>> can often benefit from re2j merely by replacing java.util.regex imports
>>>>>>>> with the corresponding re2j imports.
>>>>>>>
>>>>>>> that would be super-cool.
>>>>>>>
>>>>>>> Thomas
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>
>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by "Bruno P. Kinoshita" <br...@yahoo.com.br>.
That's great news! Thanks James!
Bruno
 
      From: James Ring <sj...@jdns.org>
 To: Commons Developers List <de...@commons.apache.org> 
 Sent: Tuesday, February 17, 2015 11:31 PM
 Subject: Re: Anyone interested in regular expressions, again?
   
Hey Benson,

Just wanted to let you and the rest of the commons dev list that re2j
is now in the open: please see https://github.com/google/re2j. Please
take a look!

Regards,
James

On Mon, Feb 9, 2015 at 12:16 PM, Benson Margulies <bi...@gmail.com> wrote:
> On Mon, Feb 9, 2015 at 1:36 PM, James Ring <sj...@jdns.org> wrote:
>> I'm working to bring re2j into the open, it will take some time
>> because Google's internal procedures for this kind of thing are pretty
>> lengthy. I'm hopeful it could be done in the next month or so.
>
> That is lovely news. Thanks!
>
>>
>> On Tue, Feb 3, 2015 at 12:14 PM, Benson Margulies <bi...@gmail.com> wrote:
>>> On Tue, Feb 3, 2015 at 2:39 AM, Thomas Neidhart
>>> <th...@gmail.com> wrote:
>>>> On 02/03/2015 01:46 AM, Benson Margulies wrote:
>>>>> The irony here is that the Java HSRE port happened because it seemed
>>>>> easier than an RE2 port. Note the same statements about API's pretty
>>>>> much apply.
>>>>
>>>> I am sorry, my response was not very sensible wrt your original proposal.
>>>
>>> It seems very sensible to me. A team at Google producing re2j is
>>> likely to have produced a far superior comestible to what I did. If
>>> there's any possibility that it will emerge in, oh, a month or two, I
>>> don't think it makes sense to go to the trouble to pull the HSRE code
>>> into Apache.
>>>
>>>>
>>>> If we have another implementation that works fine and has a sufficiently
>>>> large enough community then I do not see a problem to include it in the
>>>> commons project, I would certainly be interested.
>>>>
>>>> Thomas
>>>>
>>>>> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
>>>>> <th...@gmail.com> wrote:
>>>>>> On 02/02/2015 11:20 PM, James Ring wrote:
>>>>>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>>>>>> re2 library. The intention was to open source it but they just haven't got
>>>>>>> around to it.
>>>>>>>
>>>>>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>>>>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>>>>>> compatible with java.util.regex. I know from personal experience that one
>>>>>>> can often benefit from re2j merely by replacing java.util.regex imports
>>>>>>> with the corresponding re2j imports.
>>>>>>
>>>>>> that would be super-cool.
>>>>>>
>>>>>> Thomas
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org


>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org



   
 

Re: Anyone interested in regular expressions, again?

Posted by James Ring <sj...@jdns.org>.
Hey Benson,

Just wanted to let you and the rest of the commons dev list that re2j
is now in the open: please see https://github.com/google/re2j. Please
take a look!

Regards,
James

On Mon, Feb 9, 2015 at 12:16 PM, Benson Margulies <bi...@gmail.com> wrote:
> On Mon, Feb 9, 2015 at 1:36 PM, James Ring <sj...@jdns.org> wrote:
>> I'm working to bring re2j into the open, it will take some time
>> because Google's internal procedures for this kind of thing are pretty
>> lengthy. I'm hopeful it could be done in the next month or so.
>
> That is lovely news. Thanks!
>
>>
>> On Tue, Feb 3, 2015 at 12:14 PM, Benson Margulies <bi...@gmail.com> wrote:
>>> On Tue, Feb 3, 2015 at 2:39 AM, Thomas Neidhart
>>> <th...@gmail.com> wrote:
>>>> On 02/03/2015 01:46 AM, Benson Margulies wrote:
>>>>> The irony here is that the Java HSRE port happened because it seemed
>>>>> easier than an RE2 port. Note the same statements about API's pretty
>>>>> much apply.
>>>>
>>>> I am sorry, my response was not very sensible wrt your original proposal.
>>>
>>> It seems very sensible to me. A team at Google producing re2j is
>>> likely to have produced a far superior comestible to what I did. If
>>> there's any possibility that it will emerge in, oh, a month or two, I
>>> don't think it makes sense to go to the trouble to pull the HSRE code
>>> into Apache.
>>>
>>>>
>>>> If we have another implementation that works fine and has a sufficiently
>>>> large enough community then I do not see a problem to include it in the
>>>> commons project, I would certainly be interested.
>>>>
>>>> Thomas
>>>>
>>>>> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
>>>>> <th...@gmail.com> wrote:
>>>>>> On 02/02/2015 11:20 PM, James Ring wrote:
>>>>>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>>>>>> re2 library. The intention was to open source it but they just haven't got
>>>>>>> around to it.
>>>>>>>
>>>>>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>>>>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>>>>>> compatible with java.util.regex. I know from personal experience that one
>>>>>>> can often benefit from re2j merely by replacing java.util.regex imports
>>>>>>> with the corresponding re2j imports.
>>>>>>
>>>>>> that would be super-cool.
>>>>>>
>>>>>> Thomas
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by Benson Margulies <bi...@gmail.com>.
On Mon, Feb 9, 2015 at 1:36 PM, James Ring <sj...@jdns.org> wrote:
> I'm working to bring re2j into the open, it will take some time
> because Google's internal procedures for this kind of thing are pretty
> lengthy. I'm hopeful it could be done in the next month or so.

That is lovely news. Thanks!

>
> On Tue, Feb 3, 2015 at 12:14 PM, Benson Margulies <bi...@gmail.com> wrote:
>> On Tue, Feb 3, 2015 at 2:39 AM, Thomas Neidhart
>> <th...@gmail.com> wrote:
>>> On 02/03/2015 01:46 AM, Benson Margulies wrote:
>>>> The irony here is that the Java HSRE port happened because it seemed
>>>> easier than an RE2 port. Note the same statements about API's pretty
>>>> much apply.
>>>
>>> I am sorry, my response was not very sensible wrt your original proposal.
>>
>> It seems very sensible to me. A team at Google producing re2j is
>> likely to have produced a far superior comestible to what I did. If
>> there's any possibility that it will emerge in, oh, a month or two, I
>> don't think it makes sense to go to the trouble to pull the HSRE code
>> into Apache.
>>
>>>
>>> If we have another implementation that works fine and has a sufficiently
>>> large enough community then I do not see a problem to include it in the
>>> commons project, I would certainly be interested.
>>>
>>> Thomas
>>>
>>>> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
>>>> <th...@gmail.com> wrote:
>>>>> On 02/02/2015 11:20 PM, James Ring wrote:
>>>>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>>>>> re2 library. The intention was to open source it but they just haven't got
>>>>>> around to it.
>>>>>>
>>>>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>>>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>>>>> compatible with java.util.regex. I know from personal experience that one
>>>>>> can often benefit from re2j merely by replacing java.util.regex imports
>>>>>> with the corresponding re2j imports.
>>>>>
>>>>> that would be super-cool.
>>>>>
>>>>> Thomas
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by James Ring <sj...@jdns.org>.
I'm working to bring re2j into the open, it will take some time
because Google's internal procedures for this kind of thing are pretty
lengthy. I'm hopeful it could be done in the next month or so.

On Tue, Feb 3, 2015 at 12:14 PM, Benson Margulies <bi...@gmail.com> wrote:
> On Tue, Feb 3, 2015 at 2:39 AM, Thomas Neidhart
> <th...@gmail.com> wrote:
>> On 02/03/2015 01:46 AM, Benson Margulies wrote:
>>> The irony here is that the Java HSRE port happened because it seemed
>>> easier than an RE2 port. Note the same statements about API's pretty
>>> much apply.
>>
>> I am sorry, my response was not very sensible wrt your original proposal.
>
> It seems very sensible to me. A team at Google producing re2j is
> likely to have produced a far superior comestible to what I did. If
> there's any possibility that it will emerge in, oh, a month or two, I
> don't think it makes sense to go to the trouble to pull the HSRE code
> into Apache.
>
>>
>> If we have another implementation that works fine and has a sufficiently
>> large enough community then I do not see a problem to include it in the
>> commons project, I would certainly be interested.
>>
>> Thomas
>>
>>> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
>>> <th...@gmail.com> wrote:
>>>> On 02/02/2015 11:20 PM, James Ring wrote:
>>>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>>>> re2 library. The intention was to open source it but they just haven't got
>>>>> around to it.
>>>>>
>>>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>>>> compatible with java.util.regex. I know from personal experience that one
>>>>> can often benefit from re2j merely by replacing java.util.regex imports
>>>>> with the corresponding re2j imports.
>>>>
>>>> that would be super-cool.
>>>>
>>>> Thomas
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by Benson Margulies <bi...@gmail.com>.
On Tue, Feb 3, 2015 at 2:39 AM, Thomas Neidhart
<th...@gmail.com> wrote:
> On 02/03/2015 01:46 AM, Benson Margulies wrote:
>> The irony here is that the Java HSRE port happened because it seemed
>> easier than an RE2 port. Note the same statements about API's pretty
>> much apply.
>
> I am sorry, my response was not very sensible wrt your original proposal.

It seems very sensible to me. A team at Google producing re2j is
likely to have produced a far superior comestible to what I did. If
there's any possibility that it will emerge in, oh, a month or two, I
don't think it makes sense to go to the trouble to pull the HSRE code
into Apache.

>
> If we have another implementation that works fine and has a sufficiently
> large enough community then I do not see a problem to include it in the
> commons project, I would certainly be interested.
>
> Thomas
>
>> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
>> <th...@gmail.com> wrote:
>>> On 02/02/2015 11:20 PM, James Ring wrote:
>>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>>> re2 library. The intention was to open source it but they just haven't got
>>>> around to it.
>>>>
>>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>>> compatible with java.util.regex. I know from personal experience that one
>>>> can often benefit from re2j merely by replacing java.util.regex imports
>>>> with the corresponding re2j imports.
>>>
>>> that would be super-cool.
>>>
>>> Thomas
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by Thomas Neidhart <th...@gmail.com>.
On 02/03/2015 01:46 AM, Benson Margulies wrote:
> The irony here is that the Java HSRE port happened because it seemed
> easier than an RE2 port. Note the same statements about API's pretty
> much apply.

I am sorry, my response was not very sensible wrt your original proposal.

If we have another implementation that works fine and has a sufficiently
large enough community then I do not see a problem to include it in the
commons project, I would certainly be interested.

Thomas

> On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
> <th...@gmail.com> wrote:
>> On 02/02/2015 11:20 PM, James Ring wrote:
>>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>>> re2 library. The intention was to open source it but they just haven't got
>>> around to it.
>>>
>>> I may try and get Google to put re2j up on GitHub so you all can take a
>>> look. AFAIK it is heavily used in Google and it has an API that is largely
>>> compatible with java.util.regex. I know from personal experience that one
>>> can often benefit from re2j merely by replacing java.util.regex imports
>>> with the corresponding re2j imports.
>>
>> that would be super-cool.
>>
>> Thomas
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by Benson Margulies <bi...@gmail.com>.
The irony here is that the Java HSRE port happened because it seemed
easier than an RE2 port. Note the same statements about API's pretty
much apply.

On Mon, Feb 2, 2015 at 6:21 PM, Thomas Neidhart
<th...@gmail.com> wrote:
> On 02/02/2015 11:20 PM, James Ring wrote:
>> I spoke to one of the authors of re2j, a Google-internal port of the C++
>> re2 library. The intention was to open source it but they just haven't got
>> around to it.
>>
>> I may try and get Google to put re2j up on GitHub so you all can take a
>> look. AFAIK it is heavily used in Google and it has an API that is largely
>> compatible with java.util.regex. I know from personal experience that one
>> can often benefit from re2j merely by replacing java.util.regex imports
>> with the corresponding re2j imports.
>
> that would be super-cool.
>
> Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by Thomas Neidhart <th...@gmail.com>.
On 02/02/2015 11:20 PM, James Ring wrote:
> I spoke to one of the authors of re2j, a Google-internal port of the C++
> re2 library. The intention was to open source it but they just haven't got
> around to it.
> 
> I may try and get Google to put re2j up on GitHub so you all can take a
> look. AFAIK it is heavily used in Google and it has an API that is largely
> compatible with java.util.regex. I know from personal experience that one
> can often benefit from re2j merely by replacing java.util.regex imports
> with the corresponding re2j imports.

that would be super-cool.

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by James Ring <sj...@jdns.org>.
I spoke to one of the authors of re2j, a Google-internal port of the C++
re2 library. The intention was to open source it but they just haven't got
around to it.

I may try and get Google to put re2j up on GitHub so you all can take a
look. AFAIK it is heavily used in Google and it has an API that is largely
compatible with java.util.regex. I know from personal experience that one
can often benefit from re2j merely by replacing java.util.regex imports
with the corresponding re2j imports.

Regards,
James
On Feb 1, 2015 11:44 PM, "Thomas Neidhart" <th...@gmail.com>
wrote:

> On 02/02/2015 03:25 AM, sebb wrote:
> > I would not wish to move away from Java RE *unless* the RE syntax was
> > the same *and* the implementation was better performing *and* the
> > existing code suffered from poor performance.
> >
> > It might be OK if the alternate implementation was missing some
> > esoteric features, but I would be very wary of using any features that
> > were not in the Java implementation.
> >
> > The likelihood is that the Java implementation will (eventually)
> > become more performant, at which point it would be useful to be able
> > to revert to the Java version.
> > That requires a high degree of compatibilty to reduce the work involved.
> >
> > It might be more useful to produce a tool that detects inefficient RE
> > usage and suggests improvements.
>
> I just know re2 a bit, but it is a trade-off:
>
>  * linear-time evaluation vs. some features (e.g. backreferences)
>
> A comparison between different regular expression implementations can be
> found here:
>
> http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines
>
> I am pretty sure the regexp implementation in java will not change,
> simply because of backwards compatibility reasons, but such a library
> would be useful as in many cases you do not need these additional
> features but want to ensure that your regular expression will be
> evaluated in linear time.
>
> Thomas
>
> >
> >
> > On 1 February 2015 at 22:35, James Carman <ja...@carmanconsulting.com>
> wrote:
> >> To be clear, I am not advocating this approach.  I was merely trying to
> >> illustrate what a nightmare such an endeavor would be. :)
> >>
> >> On Sunday, February 1, 2015, James Carman <ja...@carmanconsulting.com>
> >> wrote:
> >>
> >>> You would basically have to pick a canonical regex language if you
> want a
> >>> facade and be able to swap the regex library out.  Most of them are
> very
> >>> similar but they are not the same.
> >>>
> >>> On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
> >>> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
> >>>
> >>>> I think we'll need some clear performance advantages documented as
> well as
> >>>> any compatibility issues.
> >>>>
> >>>> This begs for a facade API IMO. I would not want to recode my app
> just to
> >>>> test one vs. the other, it should be pluggable.
> >>>>
> >>>> Gary
> >>>>
> >>>> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <
> bimargulies@gmail.com
> >>>>>
> >>>> wrote:
> >>>>
> >>>>> So, once upon a time, there was a regex library here. It was retired,
> >>>>> presumably on the grounds that it was rendered obsolete by the JRE's
> >>>>> native support.
> >>>>>
> >>>>> However, the JRE's regular expressions have a pretty severe problem;
> >>>>> they have unbounded (or at least, very, very, bad) execution time for
> >>>>> some combinations of data and regex.
> >>>>>
> >>>>> To cope with this, we ported the Henry Spencer regular expression
> >>>>> library (as found in TCL) from C to Java.
> >>>>>
> >>>>> Thus: https://github.com/basis-technology-corp/tcl-regex-java
> >>>>>
> >>>>> Is anyone interested in this? Give or take the possible IP muddle of
> >>>>> the original C Code, I could grant it easily.
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >>>>> For additional commands, e-mail: dev-help@commons.apache.org
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>> --
> >>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> >>>> Java Persistence with Hibernate, Second Edition
> >>>> <http://www.manning.com/bauer3/>
> >>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> >>>> Spring Batch in Action <http://www.manning.com/templier/>
> >>>> Blog: http://garygregory.wordpress.com
> >>>> Home: http://garygregory.com/
> >>>> Tweet! http://twitter.com/GaryGregory
> >>>>
> >>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: Anyone interested in regular expressions, again?

Posted by Thomas Neidhart <th...@gmail.com>.
On 02/02/2015 03:25 AM, sebb wrote:
> I would not wish to move away from Java RE *unless* the RE syntax was
> the same *and* the implementation was better performing *and* the
> existing code suffered from poor performance.
> 
> It might be OK if the alternate implementation was missing some
> esoteric features, but I would be very wary of using any features that
> were not in the Java implementation.
> 
> The likelihood is that the Java implementation will (eventually)
> become more performant, at which point it would be useful to be able
> to revert to the Java version.
> That requires a high degree of compatibilty to reduce the work involved.
> 
> It might be more useful to produce a tool that detects inefficient RE
> usage and suggests improvements.

I just know re2 a bit, but it is a trade-off:

 * linear-time evaluation vs. some features (e.g. backreferences)

A comparison between different regular expression implementations can be
found here:

http://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines

I am pretty sure the regexp implementation in java will not change,
simply because of backwards compatibility reasons, but such a library
would be useful as in many cases you do not need these additional
features but want to ensure that your regular expression will be
evaluated in linear time.

Thomas

> 
> 
> On 1 February 2015 at 22:35, James Carman <ja...@carmanconsulting.com> wrote:
>> To be clear, I am not advocating this approach.  I was merely trying to
>> illustrate what a nightmare such an endeavor would be. :)
>>
>> On Sunday, February 1, 2015, James Carman <ja...@carmanconsulting.com>
>> wrote:
>>
>>> You would basically have to pick a canonical regex language if you want a
>>> facade and be able to swap the regex library out.  Most of them are very
>>> similar but they are not the same.
>>>
>>> On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
>>> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
>>>
>>>> I think we'll need some clear performance advantages documented as well as
>>>> any compatibility issues.
>>>>
>>>> This begs for a facade API IMO. I would not want to recode my app just to
>>>> test one vs. the other, it should be pluggable.
>>>>
>>>> Gary
>>>>
>>>> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <bimargulies@gmail.com
>>>>>
>>>> wrote:
>>>>
>>>>> So, once upon a time, there was a regex library here. It was retired,
>>>>> presumably on the grounds that it was rendered obsolete by the JRE's
>>>>> native support.
>>>>>
>>>>> However, the JRE's regular expressions have a pretty severe problem;
>>>>> they have unbounded (or at least, very, very, bad) execution time for
>>>>> some combinations of data and regex.
>>>>>
>>>>> To cope with this, we ported the Henry Spencer regular expression
>>>>> library (as found in TCL) from C to Java.
>>>>>
>>>>> Thus: https://github.com/basis-technology-corp/tcl-regex-java
>>>>>
>>>>> Is anyone interested in this? Give or take the possible IP muddle of
>>>>> the original C Code, I could grant it easily.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> Java Persistence with Hibernate, Second Edition
>>>> <http://www.manning.com/bauer3/>
>>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>>> Spring Batch in Action <http://www.manning.com/templier/>
>>>> Blog: http://garygregory.wordpress.com
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
>>>>
>>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by sebb <se...@gmail.com>.
I would not wish to move away from Java RE *unless* the RE syntax was
the same *and* the implementation was better performing *and* the
existing code suffered from poor performance.

It might be OK if the alternate implementation was missing some
esoteric features, but I would be very wary of using any features that
were not in the Java implementation.

The likelihood is that the Java implementation will (eventually)
become more performant, at which point it would be useful to be able
to revert to the Java version.
That requires a high degree of compatibilty to reduce the work involved.

It might be more useful to produce a tool that detects inefficient RE
usage and suggests improvements.


On 1 February 2015 at 22:35, James Carman <ja...@carmanconsulting.com> wrote:
> To be clear, I am not advocating this approach.  I was merely trying to
> illustrate what a nightmare such an endeavor would be. :)
>
> On Sunday, February 1, 2015, James Carman <ja...@carmanconsulting.com>
> wrote:
>
>> You would basically have to pick a canonical regex language if you want a
>> facade and be able to swap the regex library out.  Most of them are very
>> similar but they are not the same.
>>
>> On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
>> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
>>
>>> I think we'll need some clear performance advantages documented as well as
>>> any compatibility issues.
>>>
>>> This begs for a facade API IMO. I would not want to recode my app just to
>>> test one vs. the other, it should be pluggable.
>>>
>>> Gary
>>>
>>> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <bimargulies@gmail.com
>>> >
>>> wrote:
>>>
>>> > So, once upon a time, there was a regex library here. It was retired,
>>> > presumably on the grounds that it was rendered obsolete by the JRE's
>>> > native support.
>>> >
>>> > However, the JRE's regular expressions have a pretty severe problem;
>>> > they have unbounded (or at least, very, very, bad) execution time for
>>> > some combinations of data and regex.
>>> >
>>> > To cope with this, we ported the Henry Spencer regular expression
>>> > library (as found in TCL) from C to Java.
>>> >
>>> > Thus: https://github.com/basis-technology-corp/tcl-regex-java
>>> >
>>> > Is anyone interested in this? Give or take the possible IP muddle of
>>> > the original C Code, I could grant it easily.
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> > For additional commands, e-mail: dev-help@commons.apache.org
>>> >
>>> >
>>>
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by Gary Gregory <ga...@gmail.com>.
SQL is a language but it differs wildly from DBMS to DBMS. Good luck
writing a real application that uses _only_ SQL92 constructs...

Gary

On Mon, Feb 2, 2015 at 9:16 AM, James Carman <ja...@carmanconsulting.com>
wrote:

> With JDBC you have a common language, SQL.  Unless you're saying you pick
> the Java regex language as the standard and adapt to the others, you would
> have to come up with (or choose) another regex language.  My point is that
> creating a facade (a la commons-logging or slf4j) for regex would be
> troublesome because you have to support the same exact regex regardless of
> the underlying implementation and that would most likely involve some
> translation, since the regex libraries out there do not support the same
> syntax.  Merely coming up with the API is not difficult at all.  Perhaps
> you did not mean to provide a general purpose façade, but only one that
> supports the two libraries in question (assuming this other library
> supports Java regex)?
>
> On Monday, February 2, 2015, Gary Gregory <ga...@gmail.com> wrote:
>
> > On Sun, Feb 1, 2015 at 5:35 PM, James Carman <james@carmanconsulting.com
> > <javascript:;>>
> > wrote:
> >
> > > To be clear, I am not advocating this approach.  I was merely trying to
> > > illustrate what a nightmare such an endeavor would be. :)
> > >
> > > On Sunday, February 1, 2015, James Carman <james@carmanconsulting.com
> > <javascript:;>>
> > > wrote:
> > >
> > > > You would basically have to pick a canonical regex language if you
> > want a
> > > > facade and be able to swap the regex library out.  Most of them are
> > very
> > > > similar but they are not the same.
> > >
> >
> > I would not need a canonical regex language. This could be like JDBC
> where
> > implementations vary.
> >
> > Gary
> >
> > >
> > > > On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
> > <javascript:;>
> > > > <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com
> <javascript:;>');>>
> > wrote:
> > > >
> > > >> I think we'll need some clear performance advantages documented as
> > well
> > > as
> > > >> any compatibility issues.
> > > >>
> > > >> This begs for a facade API IMO. I would not want to recode my app
> just
> > > to
> > > >> test one vs. the other, it should be pluggable.
> > > >>
> > > >> Gary
> > > >>
> > > >> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <
> > > bimargulies@gmail.com <javascript:;>
> > > >> >
> > > >> wrote:
> > > >>
> > > >> > So, once upon a time, there was a regex library here. It was
> > retired,
> > > >> > presumably on the grounds that it was rendered obsolete by the
> JRE's
> > > >> > native support.
> > > >> >
> > > >> > However, the JRE's regular expressions have a pretty severe
> problem;
> > > >> > they have unbounded (or at least, very, very, bad) execution time
> > for
> > > >> > some combinations of data and regex.
> > > >> >
> > > >> > To cope with this, we ported the Henry Spencer regular expression
> > > >> > library (as found in TCL) from C to Java.
> > > >> >
> > > >> > Thus: https://github.com/basis-technology-corp/tcl-regex-java
> > > >> >
> > > >> > Is anyone interested in this? Give or take the possible IP muddle
> of
> > > >> > the original C Code, I could grant it easily.
> > > >> >
> > > >> >
> > ---------------------------------------------------------------------
> > > >> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > <javascript:;>
> > > >> > For additional commands, e-mail: dev-help@commons.apache.org
> > <javascript:;>
> > > >> >
> > > >> >
> > > >>
> > > >>
> > > >> --
> > > >> E-Mail: garydgregory@gmail.com <javascript:;> | ggregory@apache.org
> > <javascript:;>
> > > >> Java Persistence with Hibernate, Second Edition
> > > >> <http://www.manning.com/bauer3/>
> > > >> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > > >> Spring Batch in Action <http://www.manning.com/templier/>
> > > >> Blog: http://garygregory.wordpress.com
> > > >> Home: http://garygregory.com/
> > > >> Tweet! http://twitter.com/GaryGregory
> > > >>
> > > >
> > >
> >
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com <javascript:;> | ggregory@apache.org
> > <javascript:;>
> > Java Persistence with Hibernate, Second Edition
> > <http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Anyone interested in regular expressions, again?

Posted by James Carman <ja...@carmanconsulting.com>.
With JDBC you have a common language, SQL.  Unless you're saying you pick
the Java regex language as the standard and adapt to the others, you would
have to come up with (or choose) another regex language.  My point is that
creating a facade (a la commons-logging or slf4j) for regex would be
troublesome because you have to support the same exact regex regardless of
the underlying implementation and that would most likely involve some
translation, since the regex libraries out there do not support the same
syntax.  Merely coming up with the API is not difficult at all.  Perhaps
you did not mean to provide a general purpose façade, but only one that
supports the two libraries in question (assuming this other library
supports Java regex)?

On Monday, February 2, 2015, Gary Gregory <ga...@gmail.com> wrote:

> On Sun, Feb 1, 2015 at 5:35 PM, James Carman <james@carmanconsulting.com
> <javascript:;>>
> wrote:
>
> > To be clear, I am not advocating this approach.  I was merely trying to
> > illustrate what a nightmare such an endeavor would be. :)
> >
> > On Sunday, February 1, 2015, James Carman <james@carmanconsulting.com
> <javascript:;>>
> > wrote:
> >
> > > You would basically have to pick a canonical regex language if you
> want a
> > > facade and be able to swap the regex library out.  Most of them are
> very
> > > similar but they are not the same.
> >
>
> I would not need a canonical regex language. This could be like JDBC where
> implementations vary.
>
> Gary
>
> >
> > > On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
> <javascript:;>
> > > <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com <javascript:;>');>>
> wrote:
> > >
> > >> I think we'll need some clear performance advantages documented as
> well
> > as
> > >> any compatibility issues.
> > >>
> > >> This begs for a facade API IMO. I would not want to recode my app just
> > to
> > >> test one vs. the other, it should be pluggable.
> > >>
> > >> Gary
> > >>
> > >> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <
> > bimargulies@gmail.com <javascript:;>
> > >> >
> > >> wrote:
> > >>
> > >> > So, once upon a time, there was a regex library here. It was
> retired,
> > >> > presumably on the grounds that it was rendered obsolete by the JRE's
> > >> > native support.
> > >> >
> > >> > However, the JRE's regular expressions have a pretty severe problem;
> > >> > they have unbounded (or at least, very, very, bad) execution time
> for
> > >> > some combinations of data and regex.
> > >> >
> > >> > To cope with this, we ported the Henry Spencer regular expression
> > >> > library (as found in TCL) from C to Java.
> > >> >
> > >> > Thus: https://github.com/basis-technology-corp/tcl-regex-java
> > >> >
> > >> > Is anyone interested in this? Give or take the possible IP muddle of
> > >> > the original C Code, I could grant it easily.
> > >> >
> > >> >
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> <javascript:;>
> > >> > For additional commands, e-mail: dev-help@commons.apache.org
> <javascript:;>
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> E-Mail: garydgregory@gmail.com <javascript:;> | ggregory@apache.org
> <javascript:;>
> > >> Java Persistence with Hibernate, Second Edition
> > >> <http://www.manning.com/bauer3/>
> > >> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > >> Spring Batch in Action <http://www.manning.com/templier/>
> > >> Blog: http://garygregory.wordpress.com
> > >> Home: http://garygregory.com/
> > >> Tweet! http://twitter.com/GaryGregory
> > >>
> > >
> >
>
>
>
> --
> E-Mail: garydgregory@gmail.com <javascript:;> | ggregory@apache.org
> <javascript:;>
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

Re: Anyone interested in regular expressions, again?

Posted by Gary Gregory <ga...@gmail.com>.
On Sun, Feb 1, 2015 at 5:35 PM, James Carman <ja...@carmanconsulting.com>
wrote:

> To be clear, I am not advocating this approach.  I was merely trying to
> illustrate what a nightmare such an endeavor would be. :)
>
> On Sunday, February 1, 2015, James Carman <ja...@carmanconsulting.com>
> wrote:
>
> > You would basically have to pick a canonical regex language if you want a
> > facade and be able to swap the regex library out.  Most of them are very
> > similar but they are not the same.
>

I would not need a canonical regex language. This could be like JDBC where
implementations vary.

Gary

>
> > On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
> > <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
> >
> >> I think we'll need some clear performance advantages documented as well
> as
> >> any compatibility issues.
> >>
> >> This begs for a facade API IMO. I would not want to recode my app just
> to
> >> test one vs. the other, it should be pluggable.
> >>
> >> Gary
> >>
> >> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <
> bimargulies@gmail.com
> >> >
> >> wrote:
> >>
> >> > So, once upon a time, there was a regex library here. It was retired,
> >> > presumably on the grounds that it was rendered obsolete by the JRE's
> >> > native support.
> >> >
> >> > However, the JRE's regular expressions have a pretty severe problem;
> >> > they have unbounded (or at least, very, very, bad) execution time for
> >> > some combinations of data and regex.
> >> >
> >> > To cope with this, we ported the Henry Spencer regular expression
> >> > library (as found in TCL) from C to Java.
> >> >
> >> > Thus: https://github.com/basis-technology-corp/tcl-regex-java
> >> >
> >> > Is anyone interested in this? Give or take the possible IP muddle of
> >> > the original C Code, I could grant it easily.
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> > For additional commands, e-mail: dev-help@commons.apache.org
> >> >
> >> >
> >>
> >>
> >> --
> >> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> >> Java Persistence with Hibernate, Second Edition
> >> <http://www.manning.com/bauer3/>
> >> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> >> Spring Batch in Action <http://www.manning.com/templier/>
> >> Blog: http://garygregory.wordpress.com
> >> Home: http://garygregory.com/
> >> Tweet! http://twitter.com/GaryGregory
> >>
> >
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Anyone interested in regular expressions, again?

Posted by James Carman <ja...@carmanconsulting.com>.
To be clear, I am not advocating this approach.  I was merely trying to
illustrate what a nightmare such an endeavor would be. :)

On Sunday, February 1, 2015, James Carman <ja...@carmanconsulting.com>
wrote:

> You would basically have to pick a canonical regex language if you want a
> facade and be able to swap the regex library out.  Most of them are very
> similar but they are not the same.
>
> On Sunday, February 1, 2015, Gary Gregory <garydgregory@gmail.com
> <javascript:_e(%7B%7D,'cvml','garydgregory@gmail.com');>> wrote:
>
>> I think we'll need some clear performance advantages documented as well as
>> any compatibility issues.
>>
>> This begs for a facade API IMO. I would not want to recode my app just to
>> test one vs. the other, it should be pluggable.
>>
>> Gary
>>
>> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <bimargulies@gmail.com
>> >
>> wrote:
>>
>> > So, once upon a time, there was a regex library here. It was retired,
>> > presumably on the grounds that it was rendered obsolete by the JRE's
>> > native support.
>> >
>> > However, the JRE's regular expressions have a pretty severe problem;
>> > they have unbounded (or at least, very, very, bad) execution time for
>> > some combinations of data and regex.
>> >
>> > To cope with this, we ported the Henry Spencer regular expression
>> > library (as found in TCL) from C to Java.
>> >
>> > Thus: https://github.com/basis-technology-corp/tcl-regex-java
>> >
>> > Is anyone interested in this? Give or take the possible IP muddle of
>> > the original C Code, I could grant it easily.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: dev-help@commons.apache.org
>> >
>> >
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>

Re: Anyone interested in regular expressions, again?

Posted by Benson Margulies <bi...@gmail.com>.
Are you all familiar with the expression, 'excessive fascination with
the Apache brand?' Here I am expressing the exact opposite. If there
are people out there reading this who have a potential use for this
thing, I encourage them to kick its tires. If that leads to some
enthusiasm, I'm willing to do the work to make it into a contribution.
I am not trying to persuade the commons PMC to accept it just on my
say-so.  You will find that the API is within a tiny amount of code of
being facaded to match the JRE API, but, as noted, the language
differences amongst the various libraries make this of questionable
value. Mapping between then is far from easy -- unless you want to
start from this code, and then write an NFA->regex converter for the
various syntaces!

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Anyone interested in regular expressions, again?

Posted by James Carman <ja...@carmanconsulting.com>.
You would basically have to pick a canonical regex language if you want a
facade and be able to swap the regex library out.  Most of them are very
similar but they are not the same.

On Sunday, February 1, 2015, Gary Gregory <ga...@gmail.com> wrote:

> I think we'll need some clear performance advantages documented as well as
> any compatibility issues.
>
> This begs for a facade API IMO. I would not want to recode my app just to
> test one vs. the other, it should be pluggable.
>
> Gary
>
> On Sat, Jan 31, 2015 at 10:58 AM, Benson Margulies <bimargulies@gmail.com
> <javascript:;>>
> wrote:
>
> > So, once upon a time, there was a regex library here. It was retired,
> > presumably on the grounds that it was rendered obsolete by the JRE's
> > native support.
> >
> > However, the JRE's regular expressions have a pretty severe problem;
> > they have unbounded (or at least, very, very, bad) execution time for
> > some combinations of data and regex.
> >
> > To cope with this, we ported the Henry Spencer regular expression
> > library (as found in TCL) from C to Java.
> >
> > Thus: https://github.com/basis-technology-corp/tcl-regex-java
> >
> > Is anyone interested in this? Give or take the possible IP muddle of
> > the original C Code, I could grant it easily.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> <javascript:;>
> > For additional commands, e-mail: dev-help@commons.apache.org
> <javascript:;>
> >
> >
>
>
> --
> E-Mail: garydgregory@gmail.com <javascript:;> | ggregory@apache.org
> <javascript:;>
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>