Skip to content

Add simple regex capture group wrapper #214

Open
@terrorbyte

Description

@terrorbyte

There's a couple of really simple functions that we have used to a pretty extreme degree that might save a decent amount of time to just wrap in a simple function just to increase ergonomics. One of the very first ones is just a simple regex capture group single match such as:

matches := regexp.MustCompile(`'settings':'([0-9a-zA-Z+/=]+)','dialogTriggerIDList'`).FindStringSubmatch(body)
if len(matches) != 2 {
        return "", false
}

return matches[1], true

Might be worth just dropping this into a single function.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions