Jump to content
  • 0

(Archived) Regular Expressions Search in Evernote



Hello there,

I have been using evernote for a few months now, and I love it. The ability to capture almost any digital content, and then able to search it. Oh, did I say search it too! Okay, here is a little bit of a problem I am running into.

I often times store text content that I need to search later for for precise phrases and regular expressions. You know, all those lines in which "darling" is followed by "dear", or more realistically, "WebHandler" is followed by "function". And as many of you can attest, this kind of precise searching is not Evernote's strengths, unfortunately.

So, I found the place where evernote stores its content (~/Library/Application Support/Evernote in Mac), and then just run grep on that directory (well, grep is very slow, so I actually make a git repo out of the directory, and run "git grep", which turns out to be more than 10 or sometimes 50 times faster). That works quite well, except for... yes, except for... follow along...

The problem is that I want to search through the title and content of a post. But evernote stores the titles only in logs, not with actual posts. And posts are stored in strange looking files.

Executing... [git --no-pager grep -C1 -I -i -n --full-name --color=auto --all-match -e "function" -e "webhandler"]
data/101370/content/p1864/content.enml:5:<div>function MyAwesomeWebHandler {</div>
data/101370/content/p1864/content.enml-6-<div> echo "Hello World\n";</div>

So, once I find the appropriate file (using the command above) that contain the appropriate keywords, it is hard to go back and find the actual note that has it. And this method is not able to find keywords in the title. Well, it can, but it hard to map back to actual notes in evernote.

Executing... [git --no-pager grep -C1 -I -i -n --full-name --color=auto --all-match -e "open graph title"]
logs/Evernote.3.log-4-2012-01-20 12:17:47 0xc12e20 [ENNoteAttributeFieldController] DEBUG: Updating note property 'title' from text field.
logs/Evernote.3.log:5:2012-01-20 12:17:47 0x1bbf4340 [ENNoteReIndexOperation] INFO: Reindexing note: 'Untitled Note Open Graph Title' [3ae2c01e-831f-44c3-8900-96aba931621a]
logs/Evernote.3.log-6-2012-01-20 12:18:58 0x229cc20 [ENNoteReIndexOperation] INFO: Reindexing note: 'Untitled Note' [(null)]
logs/Evernote.3.log-25-2012-01-20 12:21:21 0x1e28e370 [ENSyncEngine] INFO: Sending note changes...
logs/Evernote.3.log:26:2012-01-20 12:21:21 0x1e28e370 [ENSyncEngine] INFO: Syncing note: 'Untitled Note Open Graph Title' 3ae2c01e-831f-44c3-8900-96aba931621a
logs/Evernote.3.log-27-2012-01-20 12:21:21 0x1e28e370 [ENSyncEngine] INFO: Syncing note: 'Test2 Note' <no guid>

How the hell I am easily supposed to get a handle on corresponding note in the evenote UI? :-) I can see that there is a unique ID of the post, but how do I access that post easily in the evenote UI?

If you have got any ideas, and have tried something like this, I will appreciate any help. Or if you have got a better method of doing regular expressions search in evernote, I would love to hear that too. May be I am just making it way more complicated than it has to be. :-)

Thanks for reading,


Link to comment

6 replies to this idea

Recommended Posts

  • Level 5*

Interesting -- I didn't know that Evernote stores its notes in ENML format (starting point for understanding what ENML is would be the Web API reference, which Metrodon referenced) on the Mac. That surprises me, actually. I don't know of any other way of reliably doing regex searches on note content than going through the API. I'd check in on the Evernote for Developers subforum; you might find someone who has been through all this before.

Link to comment
  • Level 5*

evernote has really impressive search functions, but i have never understood why they don't just go with grep expressions. as it stands, some of the published evernote search operands either don't work or work differently across platforms. so sad.

would houdah help the op? the includes my en db in its searches.

Link to comment
  • Level 5*

As I understand it, the desktop clients, note content is indexed for fast interactive (search-as-you-type) lookup. The search grammar supports this (and I think that all global searches must use the grammar), but to support full-on regexes in the grammar would not allow these quick lookups to be used. They seem to have come down on the side of the quick, easy lookups.

The grammar is supposed to work the same on all platforms. If it doesn't, then that a bug in the implementation.

Link to comment
  • Level 5

ENML is indeed well documented. It's HTML (more or less) wrapped within a CDATA in XML. It's parseable but would need pre-processing to be parsed using XML tools. You could use grep etc if you didn't care too much about structure.

Having in the past used Applescript (and PHP and Python separately) to extract note content you could perhaps rig this up yourself. But it's probably not worth it.

Sadly there doesn't appear to be a regex flavour of any of the tools for processing XML either.


Link to comment


This topic is now archived and is closed to further replies.

  • Create New...