Why aren't these non-capturing regex groups working right?
问题 So I spent a lot of time on another stack overflow question, and the same problem came up with a previous one. Non-capturing groups aren't working as I'd expect them to, or so I believe. This is a silly example along the lines of someone else's CSS test string... Here's my regex: (?:(rgb\([^)]*\)|\S+)(?:[ ]+)?)* And here's the test string: 1px solid rgb(255, 255, 255) test rgb(255, 255, 255) I'm expecting match groups of "1px","solid", "rgb(255, 255, 255)", "test", "rgb(255, 255, 255)" But I