ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:70148] [Ruby trunk - Bug #11399] [Open] Regexp's free-spacing mode adding whitespace to character classes
       [not found] <redmine.issue-11399.20150728092244@ruby-lang.org>
@ 2015-07-28  9:22 ` mail
  2019-08-12 23:35 ` [ruby-core:94314] [Ruby master Bug#11399] " merch-redmine
  1 sibling, 0 replies; 2+ messages in thread
From: mail @ 2015-07-28  9:22 UTC (permalink / raw
  To: ruby-core

Issue #11399 has been reported by Stefan Schüßler.

----------------------------------------
Bug #11399: Regexp's free-spacing mode adding whitespace to character classes
https://bugs.ruby-lang.org/issues/11399

* Author: Stefan Schüßler
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The *free-spacing* mode (x-option) does not ignore whitespace within character classes:

~~~
r = /[a
  # comment
b]/x

" \nab".scan(r)
#=> [" ", "\n", "a", "b"]
~~~

I would expect a regular expression that's equivalent to `/[ab]/`



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

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

* [ruby-core:94314] [Ruby master Bug#11399] Regexp's free-spacing mode adding whitespace to character classes
       [not found] <redmine.issue-11399.20150728092244@ruby-lang.org>
  2015-07-28  9:22 ` [ruby-core:70148] [Ruby trunk - Bug #11399] [Open] Regexp's free-spacing mode adding whitespace to character classes mail
@ 2019-08-12 23:35 ` merch-redmine
  1 sibling, 0 replies; 2+ messages in thread
From: merch-redmine @ 2019-08-12 23:35 UTC (permalink / raw
  To: ruby-core

Issue #11399 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Open to Rejected

This is not a bug.  The documentation suggestions the use of character classes if you want to match whitespace (https://docs.ruby-lang.org/en/trunk/regexp_rdoc.html#label-Free-Spacing+Mode+and+Comments).

----------------------------------------
Bug #11399: Regexp's free-spacing mode adding whitespace to character classes
https://bugs.ruby-lang.org/issues/11399#change-80672

* Author: sos4nt (Stefan Schüßler)
* Status: Rejected
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The *free-spacing* mode (x-option) does not ignore whitespace within character classes:

~~~
r = /[a
  # comment
b]/x

" \nab".scan(r)
#=> [" ", "\n", "a", "b"]
~~~

I would expect a regular expression that's equivalent to `/[ab]/`



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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

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

end of thread, other threads:[~2019-08-12 23:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-11399.20150728092244@ruby-lang.org>
2015-07-28  9:22 ` [ruby-core:70148] [Ruby trunk - Bug #11399] [Open] Regexp's free-spacing mode adding whitespace to character classes mail
2019-08-12 23:35 ` [ruby-core:94314] [Ruby master Bug#11399] " merch-redmine

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 read-only IMAP folder(s) and NNTP newsgroup(s).