in reply to /s does not match end-of-line

I also observe that in your original post you wrote /s ... a forward slash. Notice that certain modifier flags can appear after the regex itself, which of course is bounded by forward slashes ... /foo\s*bar/sx. These characters are not part of the pattern itself.