I've always had a question to ask. I finally have a chance today . Regular selective substitution?

Contributor ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

I want to find "áéíóú" with regular grep and replace it with the corresponding "aeiou".

that is

á=>a

é=>e

í=>i

ó=>o

ú=>u

 

Do I need to do it five times?

I seem to have seen someone who can do it all at once.

Find: [áéíóú]

Replace: I don't know how to write here

Thank you~

TOPICS
Bug , Feature request , How to , Performance , Scripting

Views

102

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

correct answers 1 Correct answer

Adobe Community Professional , Mar 13, 2022 Mar 13, 2022
I lke Peter Kahrel's script better: https://creativepro.com/files/kahrel/indesign/grep_query_manager.html It let's you save any query for later use and select from all the saved queries so you don't need to constantl;y rewrite the list.

Likes

Translate

Translate
Adobe Community Professional ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

Find: (á|é|í|ó|ú)

Change: $1

 

$1 represents a variable of the content found within the first parentheses. The pipe character means "or".

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
community guidelines
Adobe Community Professional ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

Obviously written without sufficient coffee. This would not work. Use find change by list as Joel suggests. 

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
community guidelines
Adobe Community Professional ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

There's a script that is installed by default with InDesign called "FindChangeByList".  It does exactly what you want; it lets you stack GREP queries, so you can do five at once. 

 

findchangebylist.gif

 

 

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
community guidelines
Adobe Community Professional ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

I lke Peter Kahrel's script better: https://creativepro.com/files/kahrel/indesign/grep_query_manager.html

It let's you save any query for later use and select from all the saved queries so you don't need to constantl;y rewrite the list.

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
community guidelines
Adobe Community Professional ,
Mar 13, 2022 Mar 13, 2022

Copy link to clipboard

Copied

LATEST

1000x thanks, Peter! That is miles better than FindChangeByList. Also much better than my own folder-full-of-text-files with names like AllChineseGreps2019.txt. 

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