It’s also worth pointing out that [\s\S] means a character class
containing all whitespace and non whitespace characters–in other words:
everything. This is equivalent:
"as sd “.sub(/<.?>| /,"”)
which replaces [\s\S] with .
Also, if your tags could have line breaks in them, you can add ‘m’ (for
multiline) to the end of the regular expression literal and then . will
match newlines as well:
/regex/m
Oh, and if you replace that last space (after the pipe character) with
\s, then it will match tabs too (or any whitespace for that matter).
Tom
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.