package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`public \w*\s*class (.+)\.(\w+) \{\n([^\}]*)\}$`)
var str = `Compiled from "Test.kt"
public final class com.github.animeshz.keyboard.jni.Test {
public final native void test(kotlinx.coroutines.flow.Flow<java.lang.Integer>);
public com.github.animeshz.keyboard.jni.Test();
}
`
if len(re.FindStringIndex(str)) > 0 {
fmt.Println(re.FindString(str),"found at index",re.FindStringIndex(str)[0])
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/