Yes, you understood me right. Your example is what I needed. But I
have one small question. Why is ‘?’ needed at the beginning?
(?:\s*,\s*-?\d+) It seems to me it’s the key for a correct match
Yes, you understood me right. Your example is what I needed. But I
have one small question. Why is ‘?’ needed at the beginning?
(?:\s*,\s*-?\d+) It seems to me it’s the key for a correct match
(?: … ) is the same as ( … ), save that it doesn’t set a capture
variable. It’s used for group elements of an expression together.
James Edward G. II
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.