HiSoKa wrote: ↑21 Jan 2021, 16:21
I tried too much to understand what's mean this symbols
, i didn't found it in a documentation ,, for example now we want to delete only () and [] but now why have to put all this symbol to delete only this 4 symbols , can anyone give me more explanation about it please ..
thanks in advance
You want to focus on *(\[.*?\]|\(.*?\))"
Code: Select all
* >> Have no idea.
.*? >> I asume it means all in between. https://www.autohotkey.com/docs/commands/_EscapeChar.htm
| >> (OR)
\ >> acknowledges the special characters such as "[" or "]" or \.*?+[{|()^$
If you want to preserve the content of "( )". You could use.
Code: Select all
StringReplace Clipboard, Clipboard, (,, All; ; this will delete all the "("
StringReplace Clipboard, Clipboard, ),, All; ; this will delete all the ")"
I'm using this for Roam Research.
This script retains the content between "[ ]" and gets rid of alias references "([[text]])"
Code: Select all
+!n:: ; this script retains the content between "[ ]" and gets rid of alias references "([[text]])"
clipsaved:= ClipboardAll
Clipboard := ""
Send, ^c
ClipWait ; now you copied the highlighted text
new := RegExReplace(Clipboard, " *\(\[\[.+?\]\]\)") ; this will delete all the alias page references "([[ ]])" and it's content (meaning text)
StringReplace new, new, [,, All; ; this will delete all the "["
StringReplace new, new, ],, All; ; this will delete all the "]"
MsgBox, 64, Result, %new% ; this will show you the result. You can delete if you don't need it.
Clipboard := new
RETURN