I am trying to search and replace in VS code thousands of instances, etc.
Sample String:
[[123|123]] and [[4567|4567]], also [[89|89]].
Finding [[.*|(.*)]]
and replacing with [[$1]]
turns the whole string into [[123]]
since that is the first one. The values inside the brackets could be any length of characters, but the pipe does separate them.
I tried anchoring start and end with ^[[.*|(.*)]]$
, but I’m not sure what else to try.
Wanted result:
[[123]] and [[456]], also [[789]].
New contributor
Havoc’s Call is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.