I have a note field that contains a link to a different site, but when I try to search for the note that contains a certain url my search fails. I don’t know why it’s happening. It happens for certain links but not for others.
For example, the issue is happening with this link
Read the part of the manual that talks about searching.
some characters like *, _ and " have a special meaning in Anki. If you need to locate those characters in a search, you need to tell Anki not to treat them specially.
To match something including spaces, enclose the “entire term” in double quotes.
I have quoted some parts that might be relevant to you but do read the manual on your own.
I read the manual before posting the question but I still don’t understand what I am doing wrong to be honest. I am still learning about regular expressions, so they confuse me a little bit. I just re-read the searching section of the manual and tried the following searches and I am still stumped.
Sorry mate. AFAIK using " " should’ve worked.
It works for me when I’m searching for text. BTW you are sure that piece of text exists in the field of a card (in the deck you’re searching)?
(I also tried to search for the URL by the field by doing something like this relatedTiddler:re:http://localhost:8081/#:[created[20240521160030107]]
and that didn’t work.)
I don’t search by the deck, if that’s what you are asking. But the note is in the playground deck.
", * and _
Add a backslash before these characters to treat them literally. For example, _ will match any single character, but _ matches only an actual underscore.
Colons have to be escaped unless they are preceded by another, unescaped colon. So w:e:b is a word boundary search for e:b, w:e:b searches literally for w:e:b
You tried putting / ? Hmm… weird. I’ll try then.
Edit: Okay I can escape colons but what you do about the two // ?
two backslashes are considered one backslash AFAIK.
Not sure what you mean. I am not doing anything with JavaScript or Python (or at least I don’t think so). I am searching for a note that contains a specific URL using the browser.
If you want to easily learn, how to do regex, use this page: https://regex101.com/ (and choose JavaScript on the left side, if you try to create regex for your card search :)! )