user30771 user30771 - 6 months ago 8
Perl Question

Perl what does " :\- " match?

I have the following regex:

[\s:\-]


I can't match the ":\-", already did searches on internet and tryed severel combinations...

Answer

You are trying to match just one character out of three possible: a space type character (\s), a colon (:) or a minus (-).

What you are looking for is a regex like /\s:\-/ without the brackets ([]).

Comments