What is meant by [\\s\\S]* in regex in PHP? Does [\\s\\S]* actually match every string the same as .*?
[\\s\\S]*
.*
By default . doesn't match new lines - [\s\S] is a hack around that problem. This is common in JavaScript, but in PHP you can use the /s flag to to make the dot match all characters.
.
[\s\S]
/s