+: the previous thing (here the whitespace), one or more times
In words: “a hash followed by at least one whitespace character”
#[^\s]. is:
#: a literal #
[^\s]: a negated character class. This matches anything other than the set of characters after the ^. \s has the same meaning as before, any whitespace character
. : matches any single character
In words: “a hash followed by any character other than a whitespace character, then any character”.
#\s+
is:#
: a literal#
\s
: any whitespace character (space, tab etc)+
: the previous thing (here the whitespace), one or more timesIn words: “a hash followed by at least one whitespace character”
#[^\s].
is:#
: a literal#
[^\s]
: a negated character class. This matches anything other than the set of characters after the^
.\s
has the same meaning as before, any whitespace character.
: matches any single characterIn words: “a hash followed by any character other than a whitespace character, then any character”.
https://regex101.com/ is really good for explaining regex