• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Adobe animate find and replace using regular expressions

Community Beginner ,
Mar 27, 2019 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

481

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
community guidelines
LEGEND ,
Mar 27, 2019 Mar 27, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Beginner ,
Mar 27, 2019 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.

Votes

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
community guidelines
LEGEND ,
Mar 27, 2019 Mar 27, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Beginner ,
Mar 28, 2019 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.

Votes

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
community guidelines
LEGEND ,
Mar 28, 2019 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

Votes

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
community guidelines
Community Beginner ,
Mar 28, 2019 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.

Votes

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
community guidelines
LEGEND ,
Mar 28, 2019 Mar 28, 2019

Copy link to clipboard

Copied

LATEST

It seems that it should go through all your code since you selected "whole document". 

I hope someone has some answers for you.

Votes

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
community guidelines