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

[Sharing] A stricter cloze regex #425

Closed
Ali-C-Ila opened this issue May 12, 2023 · 2 comments
Closed

[Sharing] A stricter cloze regex #425

Ali-C-Ila opened this issue May 12, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@Ali-C-Ila
Copy link

background knowledge

https://github.com/Pseudonium/Obsidian_to_Anki/wiki/Cloze-Paragraph-style
(Curlycloze also seems to have zero funtion for me, see #377 )

feature

The officially provided regex for cloze will recognize any "{", which could be really annoying when using {{templates}}, Excalidraw, etc.

So I modified this version, which only recognizes a full cloze format( with double colons) such as {{c1::text}}.

Disclaimer: This is a work of AI. I have no idea how to write regex myself, so test in a sandbox and backup your data before using this!

((?:.+\n)*(?:.*\{\{[^\{\}]*::[^\{\}]*\}\}.*)(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)

positive and negative examples

image

image

@Ali-C-Ila Ali-C-Ila changed the title A more strict cloze regex [Sharing] A more strict cloze regex May 12, 2023
@Ali-C-Ila Ali-C-Ila changed the title [Sharing] A more strict cloze regex [Sharing] A stricter cloze regex May 12, 2023
@lsolesen
Copy link

lsolesen commented Aug 13, 2023

@Ali-C-Ila This has worked well for me. However, when using Obsidian_to_Anki it goes very slow when parsing Excalidraw-drawings. I am not certain that this regex is at fault, just wanted to know whether you have any experience with that? Also see: #439

@niposch
Copy link
Contributor

niposch commented Nov 14, 2023

related #288 and #289

@ShootingKing-AM ShootingKing-AM added the documentation Improvements or additions to documentation label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants