Simple Highlight-cloze regex not working

What I’m trying to do

I want to create cloze deletion cards in Anki using Obsidian_to_anki plugin and define my clozes using == highlight syntax to keep my notes looking clean.

Things I have tried

The documented regex for Cloze-Paragraph-style works fine for me. However, the documented highlight-cloze style does not.

What I’ve done:

  1. Cloze Custom Regex in Note type table: ((?:.+\n)*(?:.*==.*)(?:\n(?:^.{1,3}$|^.{4}(?<!<!--).*))*)
  2. CurlyCloze - Highlights to Clozes in ENABLED.
  3. Added the following markdown to a file in my Vault, and Sync Vault:
IPSEC provides ==Authentication==

…I get all the expected successful notifications about the sync, but nothing appears in my target Anki deck (Default).

I have vetted my setup using Basic regex cards using the documented Sub-header style which creates cards just fine, as do basic and non-highlight cloze types.

I wasn’t sure if there could be an issue with the documented regex, so I put it and my test line from above into regex101.com, I see there is a single match group, matching the entire string:

image

…and looking at the docs for writing custom regexes in this plugin, it says:

You need to have as many capture groups in your regexp as there are fields in the note type

… and the Anki docs for cloze-deletion implies that for the cloze note type there is only a single field, so I think (?) this regex/match should be as expected. Do you see anything wrong here?

The problem was that I didn’t have BOTH CurlyCloze Obsidian_to_anki plugin settings enabled:

The docs for the highlight cloze style don’t make it clear that both are required.

I’d love to update the GitHub repo Wiki to make this more clear, but it does not appear to be editable by me, nor does the wiki appear to be in the repo, so I cannot edit it via a PR from a repo fork. Any suggestions on how to contribute here?

pardon me. I have the same problem but have yet to figure out how to fix it. I added a custom regex in the note type table and enabled both options. There’re no new cards in my anki.
I only have a problem with the cloze note type. I don’t have any issues with other note types.

Have you confirmed that your regex actually produces match(es) with something like regex101.com?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.