OneNote Gem Add-Ins

OneNote Advanced Search: Use Perl Regular Expressions to Find Paragraphs

Sometimes we need to do complex search in OneNote.
However, OneNote's keywords for search provide only simple lookup expressions.
 
OneNote Batch now provides complex regular expressions to match the paragraphs in OneNote.
Because regular expressions are complex and difficult to remember, you can search the network and learn it.
 

Use Regular Expressions to Find OneNote Paragraphs

 
In OneNote Batch:
  1. Click “Search” feature in “Search” tab.
  2. In the notebook tree, check the sections you want to search for.
  3. Check the “Perl Regular Expressions.”
  4. Enter the regular expression in the search box.
  5. Finally, click the "Start" button to start search.

Use Regular Expressions to Find OneNote Paragraphs

Common Regular Expressions

 
  • Search for paragraphs with parentheses: \(*\)
  • Search for paragraphs with email addresses: \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
  • Search for paragraphs with IP addresses: \d+\.\d+\.\d+\.\d+
  • Search for paragraphs with domain names: [a-zA-Z0-9][-a-zA-Z0-9]{0,62}(/.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+/.?
  • Search for paragraphs that starts with abc:^abc
  • Search for paragraphs ending in xyz:xyz$
  • Search for paragraphs include aaa and bbb in sequentially: (.*?)aaa(.*?)bbb(.*?)
 

Search Scope

 
The search scope of OneNote Batch:
  1. Content
  2. Title (Page Title)
  3. Tags
  4. Links
 

Not Use Windows Index

Advantages:
OneNote Batch automatically does not use Windows indexes when searching with regular expressions.
It reads OneNote pages one by one, searches for OneNote paragraphs using traversal.
Therefore, this search is not affected by OneNote search errors.
Disadvantages:
The search is slow.
 

The Processing of Search Results

  • Click on an item in the search results list to jump to the paragraph in OneNote.
  • Source code for the current paragraph: You can view the source code of the paragraph in OneNote where the current cursor is located to check why you can't search. Typically used to view escape characters for special characters in OneNote.
    For example: “<" is "&lt;" in OneNote, and ">" is “&gt;” in OneNote
  • Delete pages: Delete the pages which checked in the list of search results.
  • Move pages: Move the pages which checked in the list of search results to the specified section.
  • Export pages: Export the pages which checked in the list of search results. The following formats are supported.
    • Export to the .pdf file format.
    • Export to the .emf picture format.
    • Export to the .doc file format.
    • Export to the .mht file format.
    • Exported in .xps format.
  • Save to a new page: Save the results with a new OneNote page.
 
 
 

Demonstration

Use the OneNote Batch regular expression to find paragraphs in OneNote.