Project

General

Profile

Actions

Bug #18271

closed

Regexp inconsistency (repeatable)

Added by hanHoll (Han Holl) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
[ruby-core:105822]

Description

han:~/au> irb >> st = 'A. C. Cobble'
=> "A. C. Cobble"

st.gsub(/. ([A-Z])(?=.)/, ".#{$1}")
=> "A.. Cobble"
st.gsub(/. ([A-Z])(?=.)/, ".#{$1}")
=> "A.C. Cobble"
RUBY_VERSION
=> "3.0.2"

Actions

Also available in: Atom PDF

Like0
Like0Like0