Copy link to clipboard
Copied
Is it possible to replace above code via reg-ex group? I've tried so many variations to make it work and none of them worked.
Copy link to clipboard
Copied
Yes. you can have what you want in your find and replace.
Copy link to clipboard
Copied
I've tried to do so but it changes code into $2 instead of stop() which was 2nd group matched.
Copy link to clipboard
Copied
I tried it and it worked for me. Maybe there is a problem with the language?
Copy link to clipboard
Copied
Sorry I think I didn't precise my goal: when you are using regular expressions with groups, matched string is split into an array where:
$0 - variable that equal fully matched string
$1 - variable with 1st matched group
$2 - variable with 2nd matched group
In my question it would be: $0 - this.stop();, $1 - this, $2- stop()
I wanted to change my string this.stop(); into stop() which should be under 2nd matched group but $2 was treated like a string instead of 2nd matched group and my result was $2 instead of stop(). I've seen a vid at youtube that some guy replaced his text using reg-ex groups but I couldn't reach same result.
Copy link to clipboard
Copied
Oh OK. My bad.
Yes I think you can. Looks at the options. Click the little menu icon on the right of find and replace option and it will open this panel.
This seems to be the same panel you show. I am not sure why it is not giving you the correct result.
Copy link to clipboard
Copied
Warning msg: ,,None elements found'' I can find matched string in code only if I got code selected in ,,search(szukaj)''. In ,,text'' mode it doesn't find any matches. I don't know it work for code that is nested in frames.
Copy link to clipboard
Copied
It seems that it should go through all your code since you selected "whole document".
I hope someone has some answers for you.