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

Regexp flags or \S,\s commands #61

Open
chrispahm opened this issue Jun 8, 2018 · 1 comment
Open

Regexp flags or \S,\s commands #61

chrispahm opened this issue Jun 8, 2018 · 1 comment

Comments

@chrispahm
Copy link

Hey there,
thanks for the awesome repo!
I'm trying to match a codeblock that looks like this

equation_(a,b,c,d)
    $ (some_condition
     $ (some_other_condition)) ..

My start regex to match the equation looks like this
(?s)equation_.*?\.\., so it's effectively using the single line flag. However, it looks like embedmd does not support this kind of flags.
My other thought was to substitute these flags by something like equation_[\S\s]*?\.\. , but then embedmd also throws an error saying \S was not escaped.

Does anyone have a recommendation for me?
Thanks in advance!

@chrispahm
Copy link
Author

Alright, looks like the restrictions of POSIX ERE were not allowing the [\S\s] notation. I forked the repo and changed the regexp.CompilePosix to regexp.Compile. Also, absolute file paths can be consumed by embedmd in that version. I could do a PR, however I guess it would be better to keep using the POSIX regexp and just use the regular compile function with a certain flag. The repo can be found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant