I need some regex help.
What im trying to make is a function block parsing pattern.
the functions look like this:
fn name() {
contents
}
fn name2() {
contents2
}
I use this pattern to parse it: (fn \w+\s*\(.*\)\s*{.+(?<=}))
It works as expected, but instead of matching only to the first }, which should be the end of the "name" function, it keeps going until the last } find in the whole document basically. Can someone help me fix it?
Much appreciated.