This is a question about Regular Expressions in Swift. I have found various tutorials that mention how to do searching and matching but nothing about grouping: Here is a simple Match statement: if Regex("\\w{4}").test("ABCD") { println("matches pattern") } But what if i wanted to extract the 3rd letter: if Regex("\\w{2}(\\w)\\w").text("REGX") { print("Found a match with \$1") } What is the correct
![Swift regex - How to extract a matching group](https://cdn-ak-scissors.b.st-hatena.com/image/square/98d6f053a97a87156775f60757c60865d0f2c47d/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded)