Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 8
    why not split on ,?
    – rock321987
    Commented May 3, 2016 at 12:04
  • why not use [A-Z]+ or [^,]+ to capture the results
    – rock321987
    Commented May 3, 2016 at 12:07
  • rock321987, I've updated the input string. I need to extract exactly the string that follows the above pattern. And I need to get all the groups matched the pattern, not only the last one. I want to know how to do it with regex.
    – phbelov
    Commented May 3, 2016 at 12:09
  • 8
    rock321987, what is unclear? I need every word of the string to be a matched group, but my pattern only captures the last one ("WORLD").
    – phbelov
    Commented May 3, 2016 at 12:14
  • 1
    use this answer for finding all matches
    – rock321987
    Commented May 3, 2016 at 12:19