Skip to content

Commit

Permalink
Enable full regexp search
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasleplus authored Aug 26, 2023
1 parent 2eccedd commit 8e36b43
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ joplin.plugins.register({

const searchAndReplaceNoteNames = async (search: string, replace: string) => {
await renameSelected((noteName: string) => {
// Escape regex characters so they don't affect the search
const escapedSearch = search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
return noteName.replace(new RegExp(escapedSearch, "g"), replace);
return noteName.replace(new RegExp(search, "g"), replace);
});
};

Expand Down

0 comments on commit 8e36b43

Please sign in to comment.