Joining WIth Hyphen

A swapping-ground for Regular Expression syntax

Joining WIth Hyphen

Postby Wayne_Wickson » Tue Jan 02, 2024 12:51 am

In three of these examples, there are two names composed completely of capital letters. I need to format only these two names in capitals with only a hyphen between them leaving the rest of each filename unchanged. The routine should leave the fourth example untouched, as the second name is not composed entirely of capital letters.

2004_09_22 LAKE GARNEAU Janice_Tracy 2004_09_27.jpg

2004_09_26 ALLIN BURBANK Earl_Howard 2004_09_27.jpg

2004_09_29 HILLS WELLINGTON Florence_Gertrude 2004_10_01.jpg

2004_09_24 RAND Betty 2004_09_27.jpg

Thanks.

Wayne
Wayne_Wickson
 
Posts: 4
Joined: Tue Jan 02, 2024 12:16 am

" CAPS CAPS " ---> " CAPS-CAPS "

Postby Luuk » Wed Jan 03, 2024 1:17 am

With a checkmark for "Inc.Ext.", the "Match" and "Replace" can be like...
^(20\d\d_\d\d_\d\d [A-Z]{2,}) ([A-Z]{2,} .+)\.(?i)jpe?g
\1-\2
Luuk
 
Posts: 705
Joined: Fri Feb 21, 2020 10:58 pm

Re: Joining WIth Hyphen

Postby Wayne_Wickson » Wed Jan 03, 2024 1:58 am

This one was a winner too, Luuk! Thanks so much for taking the time to do this. :-)

Wayne
Wayne_Wickson
 
Posts: 4
Joined: Tue Jan 02, 2024 12:16 am


Return to Regular Expressions