Try This
First turn on Regular expressions
https://regex101.com/r/aW4gG2/2
Find: (\$\d+)(.*Take ')(.*)(')
Replace: \1\2\1\4
Capture
There are four groups to this Expression
Input: $250 'Hello 1' Take '____'
Group 1
(\$d+)
= $250
- this says start with a $ (escaped to be literal) then digits (\d
) 1 or more so it stops at the last digit whether it's 3 or 15. In your example they were at the start of the line but I don't assume that. If however they DO start the line then you might want to add a ^
making it ^(\Sd+)
Group 2
(.*Take ')
= 'Hello 1' Take '
- the expression says .*
which means any character any number of times so it take everything until it sees Take
and then it takes the Take '
because i wrote that out and stops there.
Group 3
(.*)
= - ____
this takes the internal space basically it takes anything 0 or more times. In this case it's all underscores but written it would grab everything and anything you have there. It would grab everything to the end of the lines except I have something following which tells it when to stop
Group 4
(')
= - '
this tells group 3 to stop at the '
mark. it also captures the '
mark in it's own group for rearranging.
Substitution
\1\2\1\4
Groups are numbered from their open parenthesis but in this case everything is linear with no nesting so it's pretty obvious. \1\2\3\4
would leave everything the way it is. But we want to replace the third group with the first group so.... \1\2\1\4
does the trick. One of the key points here was making sure we captured that fourth group to replace it at the end. Beyond that nothing too tricky.
Execution
So just set that up in your find replace and then hit replace all and that should fix you up.
Edit
I noticed you wanted to strip the $ in your replacement so you need to make some minor changes to my initial suggestions though it's basically the same.
Input: $250 'Hello 1' Take '____'
Find: (\$)(\d+)(.*Take ')(.*)(')
Replace: \1\2\3\2\5