#1 : 24/03-21 16:57 å°é˜³å…‰
Posts: 2
|
I would like to know if it is possible to make a script that can put text, or symbol between say a unicode character such as chinese, japanese or korean characters and english text, and if anyone are able to do it
in other words ", " inserted between every spacing between chinese, japanese, korean script and english such as this: æ€æ‰‹é¤åŽ… Diner æ¦å£«é©¬æ‹‰æ¾ Samurai Marathon 메소드 Method ë§ˆë” Mother ë…ì „ Believer å°ã•ãªæ‹ã®ã†ãŸ Little Love Song into: æ€æ‰‹é¤åŽ…, Diner æ¦å£«é©¬æ‹‰æ¾ï¼Œ Samurai Marathon 메소드, Method 마ë”, Mother ë…ì „ï¼Œ Believer å°ã•ãªæ‹ã®ã†ãŸï¼Œ Little Love Song Thanks in advance |
#2 : 24/03-21 19:06 David Lee
Posts: 1125
|
You don't need a script - just use a Replace method with a Regular Expression...
Replace: ([^a-z]*)( .*) With: \1,\2 NOT Case sensitive CHECK Use regular expressions |
#3 : 24/03-21 19:18 å°é˜³å…‰
Posts: 2
|
Reply to #2:
Thank you a lot, I can't say I understand exactly how it works but it seems to work fine, I was afraid the "," would end up elsewhere as well, between letters or anywhere where there is a space I use the software very often and for several years but not "deep" like this |
#4 : 24/03-21 20:07 David Lee
Posts: 1125
|
Reply to #3:
"[^a-z]" matches any character except those in the range "a to z" - the "^" character signifies "NOT" Adding "*" (ie "[^a-z]*" ) matches a string of any number of such characters. Placing the expression in parentheses captures the result in a variable: "\1" "." represents any character - so similarly "( .*)" will capture the remaining string of any characters beginning with a space and save it in the variable "\2" The replacement string \1,\2 simply places a comma between the two parts of the filename. check out the User Guide at https://www.advancedrenamer.com/user_guide/regul ar_expresions Actually a better solution probably would be... Replace: ([^\x00-\x7F]*) with \1, This will match a string of any non-ascii characters and add a comma. or simply... Replace: ([^ - ~]) with \1, which will mask a string comprising non-printable ascii characters |