Ad
  • Custom User Avatar

    I am trying to understand what's happening here.

    (w*?@) seems to be a short way of writing w.join('@').

    But what happens next escapes me still. Especially I do not understand the regex and how that plays together with gsub.

  • Custom User Avatar

    Apparently (I didn't know the syntax either) ? can be used to create literal strings of length one.

    E.g.

    irb(main):014:0> ?.
    => "."
    irb(main):015:0> ?"
    => "\""
    irb(main):016:0> ?-
    => "-"
    irb(main):017:0> ?a
    => "a"
    

    I guess this was just shorter than "." ^^