When I was thinking about going to Taiwan and trying to find a memo I made before about SIM cards, I realized when I thought about it carefully, that Atom can’t do AND search.
In other words, it can’t do general AND search like Evernote. This is today’s problem.
For example, suppose you want to do an AND search with the query “Taiwan sim”.
(sim|台湾)(.*)(sim|台湾)
I tried this first. With this,
# 台湾 sim カード
# sim 台湾
# 台湾 台湾
Lines like “台湾 台湾” also get caught.
(台湾)(.*)(sim)|(sim)(.*)(台湾)
This is the only way. When there are 3 or 4 search keywords, the regex will grow like 4x3x2x1…
Now we can search lines. …There probably exist packages for this if you look.
However, since it’s possible to do advanced searches combining with regex, let me twist it a bit more.
AND search within 3 lines
Search for strings within any 3 lines.
(台湾)(.*\n?){1,2}(sim)|(sim)(.*\n?){1,2}(台湾)
OK.
I wanted to search the range of markdown h1
I thought that by searching strings from ranges separated by ”#”, you could search one file, or in Evernote terms, one note, but I tried hard and couldn’t do it.
^#(.*\n?)+?^#
It seems the specification doesn’t overlap search result parts,
(^#(.*\n?)+?^#)+?
(^#(.*\n?)+?^#)?
No effect
^#(.*\n?)+?^(?!^#)
It seems negation can’t be used.
Summary
I think you should use this.
(台湾)(.*\n?){1,2}(sim)|(sim)(.*\n?){1,2}(台湾)