Regex Named Capture Groups

Is there any way to use named capture groups with Xojo’s built-in Regex class?

For example, let’s say I want to capture the name of the song and the location to play it in from this string:

"play happy birthday in the kitchen"

This regex will work: play (?<title>.*) in the (?<location>.*)

As far as I can tell however, the RegexMatch class that is returned by Regex.Search() provides no access to the named capture groups.

What I’m looking for is to be able to do something like:

Var rx As New Regex
rx.SearchPattern = "play (?<title>.*) in the (?<location>.*)"
Var match As RegexMatch = rx.Search("play happy birthday in the kitchen")
Var title As String = match.GroupWithName("title") // "happy birthday"

As far as I can tell, using named capture groups is fully supported in PCRE 8.33 (the version Xojo uses internally). Is there just no way to get this information out?

Yes I know I could use MonkeyBread’s regex classes (I have done in the past) but I am thinking of doing a tutorial / open source project in Xojo that would need named capture groups and many people can’t / won’t use a plugin.

No, not with the native RegEx.

Urgh. I was afraid of that. Thanks.

Feedback feature request: <https://xojo.com/issue/64703>