Erlang regex not compiling

Greetings,
I am a beginner Erlang developer and trying to get a feel for the language.
I am writing an application to parse and extract metadata headers from chess .pgn files.
I would like to run the following regex:

\[([A-Za-z]+)\s\"(.*)\"\]

While compiling, I get

{error,{"unmatched parentheses",11}}

I’ve tested the regex on regexr.com in both Javascript and PCRE mode with successful compilation and matching. Is there something obvious I am missing?

Thank you for your time!

Hello and welcome,

It’s not helping for your regex, but I wrote a pgn parser with Erlang leex and yecc. I did not publish it on hex (too small).

You might find the regex I use in src/ :slight_smile:

This one is for tag.

\[.*\".*\"\s?\]
1 Like

Thank you!