Can someone help me do a find/replace with regular expressions in Freeplane? I know regex generally but not the Java implementation. I need to replace instances of @name + space with [@name] + space (for any name following the @). e.g.:
@Smithspace
with:
[@Smith]space
This is tricky for me because [ is a special character, and Java regex uses $ in the replace string rather than \1. My previous attempts failed. What do I put in the find field and replace field? Help appreciated!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you! Do you know how to search/replace for a string that starts with a "@" and ends after the last letter or digit? So this one would work if the entire node is the replace string (with no space at the end), or if the string is followed by a space or punctuation mark.
So "Also @Smith2000: this is true" would become "Also [@Smith2000]: this is true"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can someone help me do a find/replace with regular expressions in Freeplane? I know regex generally but not the Java implementation. I need to replace instances of @name + space with [@name] + space (for any name following the @). e.g.:
@Smith
space
with:
[@Smith]
space
This is tricky for me because
[
is a special character, and Java regex uses$
in the replace string rather than\1
. My previous attempts failed. What do I put in the find field and replace field? Help appreciated!Hello, helpful community members, can anyone provide information for me here?
Hi quickfold,
this worked for me: (check "Regular expressions" box in both find and replace fields)
Note: remove the double quotes from the search / replace string
Find:
"@(.*?)\s"
Replace:
"\[@$1\] "
Last edit: Milavon 2021-10-23
Thank you! Do you know how to search/replace for a string that starts with a "@" and ends after the last letter or digit? So this one would work if the entire node is the replace string (with no space at the end), or if the string is followed by a space or punctuation mark.
So "Also @Smith2000: this is true" would become "Also [@Smith2000]: this is true"
yes I tested this one, it works as requested
Find:
@([0-9a-zA-Z]*)
Replace:
\[@$1\]
(it will surround the part starting with "@" followed only by letters and digits with
the square brackets)
Last edit: Milavon 2021-10-25