Hello once again folks!
OK, I’m still extremely new to Ruby, so if my question is stupid, please
be gentle :).
The code below is an example from a ruby book, and I look at it, I
understand most of it, but what I don’t understand is why the
author/ruby-expert has \b in the regular expression (I know it’s a
backspace), but why match for a backspace especially it’s outside of the
bracket, and why the brackets? In this context, I’m confused! I’m
talking about line number 3! Any clarification or insight would be
really helpful to me. Thank you!
text.gsub(/\b(I am|You are|I|You|Me|Your|My)\b/i) do |pronoun|
when “i am”
when “you are”