1

I'm working with strings that have a bunch of white spaces before the data I want to capture. For some reason,

(?:\\s*)(?<1>.+)

works, but

(?<1>\\S+)

does not. The former works exactly how I want it to, but the latter doesn't get any matches. Is matching white 0+ white spaces but not capturing and matching any 1+ any character and capturing not the same as matching and capturing any 1+ non-white-space characters?

Apologies if this is a duplicate; I searched and couldn't find a similar question.

astroworld
  • 19
  • 1
  • 1
    When I try them, the match the same, could you give us an example of an input string and what the expected match is? – Poul Bak Aug 07 '18 at 17:14
  • You cannot expect `.` and `\S` to match the same chars. These are basic regex constructs, see the reference at the top. – Wiktor Stribiżew Aug 07 '18 at 18:12

0 Answers0