Actions
Bug #14500
closedMissing Regexp documentation and clarification on behavior of \K for edge case
Description
Capturing section (https://ruby-doc.org/core-2.5.0/Regexp.html#class-Regexp-label-Capturing)
- formatting issue:
n<sup>th</sup>
- suggestion to add a note on
\0
similar to the note mentioned in Special global variables (https://ruby-doc.org/core-2.5.0/Regexp.html#class-Regexp-label-Special+global+variables) section about$&
- suggestion to add that numbered capturing groups is limited to
9
Anchors section (https://ruby-doc.org/core-2.5.0/Regexp.html#class-Regexp-label-Anchors)
- suggestion to add documentation on
\K
- need clarification if the below behavior seen is expected and mention it while adding documentation
$ echo 'aaa' | ruby -pe 'gsub(/a\K/, ":")'
a:aa:
$ # what I expected
$ echo 'aaa' | ruby -pe 'gsub(/(a)/, "\\1:")'
a:a:a:
Actions
Like0
Like0Like0Like0Like0Like0