(apparently it is about the space character being included multiple
times inside []).
I want the space and newlines to be disregarded inside [] to format it
over multiple lines, is this possible?
(apparently it is about the space character being included multiple
times inside []).
I don’t get that warning with ruby 1.9.2.
I want the space and newlines to be disregarded inside [] to format it
over multiple lines, is this possible?
Thanks,
Alexey.
Never write a regex with thousands of escapes. Are you aware that
inside a character class, the special regex characters lose their
special meaning?
Break up long regexes into smaller pieces.
my_char_class = ‘[A-Za-z#\d!#$%&’*±/=?^_`{|}~]’
There are actually delimiters for the string (or a regex) that are not
part of the character class, e.g. a period or the @ symbol. However,
delimiters like that are too confusing, so I just escaped the single
quote mark inside the string. One escape is all that’s needed to
properly form the string. If needed, which is not the case here, you
could also call Regexp.escape() on the string.