Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use regex library to find matching braces #112

Open
tdegeus opened this issue Jan 26, 2024 · 0 comments
Open

Use regex library to find matching braces #112

tdegeus opened this issue Jan 26, 2024 · 0 comments

Comments

@tdegeus
Copy link
Owner

tdegeus commented Jan 26, 2024

From https://stackoverflow.com/a/44019654/2646505 :

regex.search(r"[\\](My\w+)([{](?>[^{}]+|(?2))*[}])", s).group(0)

returns

\MyTitle{This is a title with some \commands{with some arguments} inside}

for

\MyTitle{This is a title with some \commands{with some arguments} inside}
which is followed by some text 
with many lines and any kind of things inside
and at some point an abstract can be defined like
\MyAbstract{%
including the abstract which can have also \commands{inside with possiblguments} or not and can longer than a line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant