ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:52014]  [Ruby master Feature#19194] Add Regexp.linear_time?
@ 2022-12-11  5:54 make_now_just (Hiroya Fujinami)
  2022-12-12  0:56 ` [ruby-dev:52015] " mame (Yusuke Endoh)
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: make_now_just (Hiroya Fujinami) @ 2022-12-11  5:54 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been reported by make_now_just (Hiroya Fujinami).

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194

* Author: make_now_just (Hiroya Fujinami)
* Status: Open
* Priority: Normal
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52015]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
@ 2022-12-12  0:56 ` mame (Yusuke Endoh)
  2022-12-12  2:05 ` [ruby-dev:52016] " matz (Yukihiro Matsumoto)
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mame (Yusuke Endoh) @ 2022-12-12  0:56 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by mame (Yusuke Endoh).


@make_now just Thank you!

I would like to propose @make_now_just as a committer. He has made a great improvement to the Regexp engine. Ruby's Regexp engine is in a state of its own fork from onigmo, and he is a valuable person who can maintain it. @matz What do you think?

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100550

* Author: make_now_just (Hiroya Fujinami)
* Status: Open
* Priority: Normal
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52016]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
  2022-12-12  0:56 ` [ruby-dev:52015] " mame (Yusuke Endoh)
@ 2022-12-12  2:05 ` matz (Yukihiro Matsumoto)
  2022-12-12  2:06 ` [ruby-dev:52017] " matz (Yukihiro Matsumoto)
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: matz (Yukihiro Matsumoto) @ 2022-12-12  2:05 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by matz (Yukihiro Matsumoto).


Accepted.

Matz.


----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100551

* Author: make_now_just (Hiroya Fujinami)
* Status: Open
* Priority: Normal
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52017]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
  2022-12-12  0:56 ` [ruby-dev:52015] " mame (Yusuke Endoh)
  2022-12-12  2:05 ` [ruby-dev:52016] " matz (Yukihiro Matsumoto)
@ 2022-12-12  2:06 ` matz (Yukihiro Matsumoto)
  2022-12-12  5:40 ` [ruby-dev:52020] " make_now_just (Hiroya Fujinami)
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: matz (Yukihiro Matsumoto) @ 2022-12-12  2:06 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by matz (Yukihiro Matsumoto).


Also accepted to nominate him a committer.

Matz.


----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100552

* Author: make_now_just (Hiroya Fujinami)
* Status: Open
* Priority: Normal
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52020]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
                   ` (2 preceding siblings ...)
  2022-12-12  2:06 ` [ruby-dev:52017] " matz (Yukihiro Matsumoto)
@ 2022-12-12  5:40 ` make_now_just (Hiroya Fujinami)
  2022-12-13  7:03 ` [ruby-dev:52022] " hsbt (Hiroshi SHIBATA)
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: make_now_just (Hiroya Fujinami) @ 2022-12-12  5:40 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by make_now_just (Hiroya Fujinami).


Thank you for accepting the change and nominating me to a committer. I welcome this nomination.

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100570

* Author: make_now_just (Hiroya Fujinami)
* Status: Open
* Priority: Normal
* Target version: 3.2
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52022]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
                   ` (3 preceding siblings ...)
  2022-12-12  5:40 ` [ruby-dev:52020] " make_now_just (Hiroya Fujinami)
@ 2022-12-13  7:03 ` hsbt (Hiroshi SHIBATA)
  2022-12-13  7:10 ` [ruby-dev:52023] " make_now_just (Hiroya Fujinami)
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-12-13  7:03 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Open to Assigned
Assignee set to make_now_just (Hiroya Fujinami)

I added write permission to @make_now_just now. Can you apply this by yourself? 

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100617

* Author: make_now_just (Hiroya Fujinami)
* Status: Assigned
* Priority: Normal
* Assignee: make_now_just (Hiroya Fujinami)
* Target version: 3.2
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52023]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
                   ` (4 preceding siblings ...)
  2022-12-13  7:03 ` [ruby-dev:52022] " hsbt (Hiroshi SHIBATA)
@ 2022-12-13  7:10 ` make_now_just (Hiroya Fujinami)
  2022-12-13  7:15 ` [ruby-dev:52024] " hsbt (Hiroshi SHIBATA)
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: make_now_just (Hiroya Fujinami) @ 2022-12-13  7:10 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by make_now_just (Hiroya Fujinami).


@hsbt Sorry, I'm not sure what "apply" means. May I merge the pull request on GitHub?

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100618

* Author: make_now_just (Hiroya Fujinami)
* Status: Assigned
* Priority: Normal
* Assignee: make_now_just (Hiroya Fujinami)
* Target version: 3.2
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52024]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
                   ` (5 preceding siblings ...)
  2022-12-13  7:10 ` [ruby-dev:52023] " make_now_just (Hiroya Fujinami)
@ 2022-12-13  7:15 ` hsbt (Hiroshi SHIBATA)
  2022-12-14 10:21 ` [ruby-dev:52026] " hsbt (Hiroshi SHIBATA)
  2022-12-25  0:06 ` [ruby-dev:52031] " jnchito (Junichi Ito) via ruby-dev
  8 siblings, 0 replies; 10+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-12-13  7:15 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by hsbt (Hiroshi SHIBATA).


>May I merge the pull request on GitHub?

Yes, you can merge it. I meant commit and push to master branch directly or merge pull-request.

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100619

* Author: make_now_just (Hiroya Fujinami)
* Status: Assigned
* Priority: Normal
* Assignee: make_now_just (Hiroya Fujinami)
* Target version: 3.2
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52026]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
                   ` (6 preceding siblings ...)
  2022-12-13  7:15 ` [ruby-dev:52024] " hsbt (Hiroshi SHIBATA)
@ 2022-12-14 10:21 ` hsbt (Hiroshi SHIBATA)
  2022-12-25  0:06 ` [ruby-dev:52031] " jnchito (Junichi Ito) via ruby-dev
  8 siblings, 0 replies; 10+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-12-14 10:21 UTC (permalink / raw)
  To: ruby-dev

Issue #19194 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Assigned to Closed

https://github.com/ruby/ruby/pull/6901 has been merged.

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100635

* Author: make_now_just (Hiroya Fujinami)
* Status: Closed
* Priority: Normal
* Assignee: make_now_just (Hiroya Fujinami)
* Target version: 3.2
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-dev:52031]  [Ruby master Feature#19194] Add Regexp.linear_time?
  2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
                   ` (7 preceding siblings ...)
  2022-12-14 10:21 ` [ruby-dev:52026] " hsbt (Hiroshi SHIBATA)
@ 2022-12-25  0:06 ` jnchito (Junichi Ito) via ruby-dev
  8 siblings, 0 replies; 10+ messages in thread
From: jnchito (Junichi Ito) via ruby-dev @ 2022-12-25  0:06 UTC (permalink / raw)
  To: ruby-dev; +Cc: jnchito (Junichi Ito)

Issue #19194 has been updated by jnchito (Junichi Ito).


I feel it would be more natural if it was defined as instance method:

``` ruby
/a/.linear_time?
Regexp.new('a').linear_time?
```

Is there any reason for class method?

----------------------------------------
Feature #19194: Add Regexp.linear_time?
https://bugs.ruby-lang.org/issues/19194#change-100792

* Author: make_now_just (Hiroya Fujinami)
* Status: Closed
* Priority: Normal
* Assignee: make_now_just (Hiroya Fujinami)
* Target version: 3.2
----------------------------------------
I suggest adding a new method named `Regexp.linear_time?` to check if matching against a given regexp can be completed in linear time by the optimization introduced in #19104 (GitHub PR [#6486](https://github.com/ruby/ruby/pull/6486)).

This method was discussed in #19104. I'm not sure the name is best.

# Example

```
Regexp.linear_time?(/a/)        # => true
Regexp.linear_time?(/(a|a)*\1/) # => false, because this uses a back-reference.

# This can accept a regexp source string and flags like `Regexp.new`.
Regexp.linear_time?('a')                     # => true
Regexp.linear_time?('a', Regexp::IGNORECASE) # => true
```

For example, this method is useful for implementing a Rubocop rule to check a regexp is ReDoS safe.

# Implementation

Implementation is done at GitHub PR [#6901](https://github.com/ruby/ruby/pull/6901).
See the details there.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-25  1:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-11  5:54 [ruby-dev:52014] [Ruby master Feature#19194] Add Regexp.linear_time? make_now_just (Hiroya Fujinami)
2022-12-12  0:56 ` [ruby-dev:52015] " mame (Yusuke Endoh)
2022-12-12  2:05 ` [ruby-dev:52016] " matz (Yukihiro Matsumoto)
2022-12-12  2:06 ` [ruby-dev:52017] " matz (Yukihiro Matsumoto)
2022-12-12  5:40 ` [ruby-dev:52020] " make_now_just (Hiroya Fujinami)
2022-12-13  7:03 ` [ruby-dev:52022] " hsbt (Hiroshi SHIBATA)
2022-12-13  7:10 ` [ruby-dev:52023] " make_now_just (Hiroya Fujinami)
2022-12-13  7:15 ` [ruby-dev:52024] " hsbt (Hiroshi SHIBATA)
2022-12-14 10:21 ` [ruby-dev:52026] " hsbt (Hiroshi SHIBATA)
2022-12-25  0:06 ` [ruby-dev:52031] " jnchito (Junichi Ito) via ruby-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).