Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > look-behind regexp ?

Reply
Thread Tools

look-behind regexp ?

 
 
Shajith
Guest
Posts: n/a
 
      03-30-2005
Hi!
Are there any plans to support look-behinds in the core regexp engine?

I'm curious as to why we don't have it.
Thanks
Shajith

PS: I found an old request about this in the archives:
http://blade.nagaokaut.ac.jp/cgi-bin.../ruby-talk/417


 
Reply With Quote
 
 
 
 
Yukihiro Matsumoto
Guest
Posts: n/a
 
      03-30-2005
Hi,

In message "Re: look-behind regexp ?"
on Wed, 30 Mar 2005 22:48:18 +0900, Shajith <(E-Mail Removed)> writes:

|Are there any plans to support look-behinds in the core regexp engine?

1.9 Oniguruma regexp engine already has one.

matz.


 
Reply With Quote
 
 
 
 
Shajith
Guest
Posts: n/a
 
      03-30-2005
On Wed, 30 Mar 2005 22:58:08 +0900, Yukihiro Matsumoto
<(E-Mail Removed)> wrote:
>
> 1.9 Oniguruma regexp engine already has one.
>
> matz.

Thanks!

Shajith


 
Reply With Quote
 
B. K. Oxley (binkley)
Guest
Posts: n/a
 
      03-30-2005
Yukihiro Matsumoto wrote:
> Shajith <(E-Mail Removed)> writes:
>> Are there any plans to support look-behinds in the core regexp
>> engine?

>
> 1.9 Oniguruma regexp engine already has one.


Where can I read more about this regexp engine? How does it compare to:

* Perl's own regexps
* regexp-engine from AEditor (http://aeditor.rubyforge.org/)
* PCRE (http://www.pcre.org/)


Thanks,
--binkley


 
Reply With Quote
 
Florian Gross
Guest
Posts: n/a
 
      03-30-2005
B. K. Oxley (binkley) wrote:

>> 1.9 Oniguruma regexp engine already has one.

> Where can I read more about this regexp engine?


http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt seems to have a
fairly complete listing of its features.
 
Reply With Quote
 
B. K. Oxley (binkley)
Guest
Posts: n/a
 
      03-30-2005
Florian Gross wrote:
> http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt seems to have a
> fairly complete listing of its features.


Ah, yes. Thanks. I should have Googled first.

But reading through that and the documentation on the same site, I am
still looking for a rationale document. Why Onigurama and not, say,
PCRE? Why a new regexp parser?


Cheers,
--binkley



 
Reply With Quote
 
Austin Ziegler
Guest
Posts: n/a
 
      03-30-2005
On Thu, 31 Mar 2005 00:29:03 +0900, B. K. Oxley (binkley)
<(E-Mail Removed)> wrote:
> Florian Gross wrote:
> > http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt seems to have a
> > fairly complete listing of its features.

> Ah, yes. Thanks. I should have Googled first.
>
> But reading through that and the documentation on the same site, I am
> still looking for a rationale document. Why Onigurama and not, say,
> PCRE? Why a new regexp parser?


1. Licensing. PCRE's licensing has been somewhat fluid. The current
release seems OK.
2. Control. In many ways, such a core feature to Ruby should be native to Ruby.
3. Native concepts. Ruby REs are a bit different because they end up
being objects.

-austin
--
Austin Ziegler * http://www.velocityreviews.com/forums/(E-Mail Removed)
* Alternate: (E-Mail Removed)


 
Reply With Quote
 
B. K. Oxley (binkley)
Guest
Posts: n/a
 
      03-30-2005
Austin Ziegler wrote:
> 1. Licensing. PCRE's licensing has been somewhat fluid. The current
> release seems OK.
> 2. Control. In many ways, such a core feature to Ruby should be native to Ruby.
> 3. Native concepts. Ruby REs are a bit different because they end up
> being objects.


Hrm.

In all honesty, these objections seem weak to me.

If the licensing is not a problem right now, why would it necessarily
become one in the future? (Although I don't know the history of
licensing in PCRE, so perhaps it has a record of arbitrariness.)

Control is not so important when you have the source code. And Ruby can
contribute to the development of PCRE.

I'm unsure what you mean in point three. I presume that a Ruby regexp
implementation would use PCRE for implementation, wrapping any details
so that the implementation is not visible, and only objects remain.

Not to be so nitpicky, I only used PCRE as an example. I have an
inherent dislike of wheel-reinvention (my natural laziness at play), so
my ears perk up when I see something like a rewrite of regexp parsers
when so many fine ones are already around.


Cheers,
--binkley


 
Reply With Quote
 
Yukihiro Matsumoto
Guest
Posts: n/a
 
      03-30-2005
Hi,

In message "Re: look-behind regexp ?"
on Thu, 31 Mar 2005 00:29:03 +0900, "B. K. Oxley (binkley)" <(E-Mail Removed)> writes:

|But reading through that and the documentation on the same site, I am
|still looking for a rationale document. Why Onigurama and not, say,
|PCRE? Why a new regexp parser?

PCRE does only support UTF-8 (as far as I know), not multiple
encodings like Ruby does. Oniguruma supports UTF-8, UTF-16,
ISO-8859-*, EUC-JP, Shift_JIS, and lot more.

matz.


 
Reply With Quote
 
B. K. Oxley (binkley)
Guest
Posts: n/a
 
      03-30-2005
Yukihiro Matsumoto wrote:
> PCRE does only support UTF-8 (as far as I know), not multiple
> encodings like Ruby does. Oniguruma supports UTF-8, UTF-16,
> ISO-8859-*, EUC-JP, Shift_JIS, and lot more.


Ah. I inferred as much from the prominence given the list of encodings,
but wanted to find out more.


Thanks,
--binkley


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
new RegExp().test() or just RegExp().test() Matěj Cepl Javascript 3 11-24-2009 02:41 PM
[regexp] How to convert string "/regexp/i" to /regexp/i - ? Joao Silva Ruby 16 08-21-2009 05:52 PM
Ruby 1.9 - ArgumentError: incompatible encoding regexp match(US-ASCII regexp with ISO-2022-JP string) Mikel Lindsaar Ruby 0 03-31-2008 10:27 AM
Programmatically turning a Regexp into an anchored Regexp Greg Hurrell Ruby 4 02-14-2007 06:56 PM
RegExp.exec() returns null when there is a match - a JavaScript RegExp bug? Uldis Bojars Javascript 2 12-17-2006 09:59 PM



Advertisments