0

not long ago someone gave me the regex to replace a list of places for Missouri with the same pattern like this in which I wanted to replace (in Spanish) to |[[X (Misuri)|X]] || ciudad || 00 , where "city" was translated to "ciudad" in Spanish, where "X" is the name of the city, and "0" the population: From this

Acacia Villas city 427

to this:

|[[Acacia Villas (Misuri)|Acacia Villas]] || ciudad || 427

This was the regex that I used to replace those lines as shown above.

Search: (.)\scity\s(.)

Replace: |[[\1 (Misuri)|\1]] || ciudad

Now, I tried to modified the regex for the replacing for another list of places in Vermont (and other states), but i couldn't create the Regex,

The list goes like this: But this time i want to translate the county into Spanish and I want to eliminate 'town' just the one that are in lower cases and County in order to translate it to Spanish.

Andover town, Tolland County 3,303

Ansonia town, New Haven County 19,249

Ashford town, Windham County 4,317

Avon town, Hartford County 18,098 etc..

At the end each line should look like this, can anyone help me? :

|[[Andover (Vermont)|Andover]] || [[condado de Tolland (Vermont)|Tolland]] || 3,303

Another question, there is another list that i want to replace this time they are townships in Arkansas, and im not sure if the same regex for the towns will work for them, so im just gonna ask for the regex now just in case, eliminating the word township and County where Municipio is township in Spanish. Thank you!

For: Acorn township, Polk County 1,503

To: |[[Municipio de Acorn (condado de Polk, Arkansas)|Acorn]] || [[condado de Polk (Arkansas)|Polk]] || 1,503

1 Answer 1

1
Search: (.*)\town,\s(.*)\Country\s(.*)
Replace: |[[\1 (Vermont)|\1]] || [[condado de \2 (Vermont)|\2]] || \3
Search: (.*)\township,\s(.*)\Country\s(.*)
Replace: |[[Municipio de \1 (condado de \2, Arkansas)|\1]] || [[condado de \2 (Arkansas)|\2]] || \3
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.