Highlighted

Adobe animate find and replace using regular expressions

Community Beginner ,
Mar 27, 2019

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.

Views

188

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Adobe animate find and replace using regular expressions

Community Beginner ,
Mar 27, 2019

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.

Views

189

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 27, 2019 1
Adobe Community Professional ,
Mar 27, 2019

Copy link to clipboard

Copied

Yes. you can have what you want in your find and replace.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 27, 2019 0
Community Beginner ,
Mar 27, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 27, 2019 0
Adobe Community Professional ,
Mar 27, 2019

Copy link to clipboard

Copied

I tried it and it worked for me. Maybe there is a problem with the language?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 27, 2019 0
Community Beginner ,
Mar 28, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2019 0
Adobe Community Professional ,
Mar 28, 2019

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.

regular expresssion.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2019 1
Community Beginner ,
Mar 28, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2019 0
Adobe Community Professional ,
Mar 28, 2019

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2019 0