https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112017-09-25T09:06:21ZRuby Issue Tracking SystemRuby master - Feature #13936: Make regular expressions debugablehttps://bugs.ruby-lang.org/issues/13936?journal_id=668922017-09-25T09:06:21Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>It needs to keep maintainability with original Onigmo/Oniguruma.</p> Ruby master - Feature #13936: Make regular expressions debugablehttps://bugs.ruby-lang.org/issues/13936?journal_id=670422017-10-03T23:58:57Zshevegen (Robert A. Heiler)shevegen@gmail.com
<ul></ul><p>I am inclined to agree with Martin. In general introspection is awesome; I remember many years ago having used Steve Dekorte's Io language; the syntax was not so nice of his language, but the introspection was really nice (I think that was back when ruby did not have method_location or source_location or whatever was the name either, so probably 1.8.x days; banister wrote that show-method thing in pry via the gem method_source, since then I can retrieve the source code to any or most ruby methods, so that is no longer a huge priority to me. But I think that in general, introspection is really great - I also love "pp"; and to quote tenderlove, "I am a puts"-debugger, that is also true, well, actually a pp-debugger :) ).</p>
<p>I remember that I ran into encoding-related problems with regexes which were not trivial to resolve for me back then.</p>
<p>I am not familiar with the internals so I can't say much about it, but I am all for better introspection; and also being able to easily set which encoding a regexp is in (I have not tried again but back when I ran into these problems, it was not so trivial to resolve).</p>
<p>The documentation says to use any of these:</p>
<pre><code>/pat/u - UTF-8
/pat/e - EUC-JP
/pat/s - Windows-31J
/pat/n - ASCII-8BIT
</code></pre>
<p>But I would ideally prefer to have Regexp also use methods similar to class<br>
String, in particular .force_encoding() which I tend to use a lot (whenever<br>
I am not using UTF-8).</p>
<p>If anyone wants to have a look at the docu of Regexp, here the quick link to<br>
the main documentation:</p>
<p><a href="https://ruby-doc.org/core/Regexp.html" class="external">https://ruby-doc.org/core/Regexp.html</a></p> Ruby master - Feature #13936: Make regular expressions debugablehttps://bugs.ruby-lang.org/issues/13936?journal_id=670442017-10-04T02:26:05ZMSP-Greg (Greg L)
<ul></ul><p>Trunk version (with TOC):<br>
<a href="https://msp-greg.github.io/ruby_trunk/Core/Regexp.html" class="external">https://msp-greg.github.io/ruby_trunk/Core/Regexp.html</a></p> Ruby master - Feature #13936: Make regular expressions debugablehttps://bugs.ruby-lang.org/issues/13936?journal_id=670492017-10-04T06:53:55Zduerst (Martin Dürst)duerst@it.aoyama.ac.jp
<ul></ul><p>shevegen (Robert A. Heiler) wrote:</p>
<blockquote>
<p>I remember that I ran into encoding-related problems with regexes which were not trivial to resolve for me back then.</p>
<p>I am not familiar with the internals so I can't say much about it, but I am all for better introspection; and also being able to easily set which encoding a regexp is in (I have not tried again but back when I ran into these problems, it was not so trivial to resolve).</p>
</blockquote>
<blockquote>
<p>But I would ideally prefer to have Regexp also use methods similar to class<br>
String, in particular .force_encoding() which I tend to use a lot (whenever<br>
I am not using UTF-8).</p>
</blockquote>
<p>I think this is a valid concern, but not directly related to the issue here. Please create a separate feature request.</p> Ruby master - Feature #13936: Make regular expressions debugablehttps://bugs.ruby-lang.org/issues/13936?journal_id=671092017-10-07T01:25:57Zkernigh (George Koehler)xkernigh@netscape.net
<ul></ul><p>Do other languages, like Perl, have a feature for debugging regular expressions?</p>