XUnity.AutoTranslator icon indicating copy to clipboard operation
XUnity.AutoTranslator copied to clipboard

regex is not matching anything

Open FlashlightET opened this issue 1 year ago • 2 comments
trafficstars

i have tested regexr, regexstorm, and notepad++ and all 3 match my text correctly. I'm trying to remove furigana before translation by simply removing anything within a size tag.

My regex (formatted how it is in _Preprocessors.txt): r:"<size(.)*?size>+"= (i have also tested it with a test string after the =, zilch)

Text I'm trying to match: <size\=15><color\=#00000000>‐‐‐‐‐‐‐‐‐‐‐‐‐‐</color></size>\n足跡の大きさや\n<size\=15><color\=#00000000>‐‐‐‐‐-</color>さんじょう<color\=#00000000>-‐‐‐‐‐‐-</color>いちもくりょうぜん<color\=#00000000>-‐</color></size>\nここの惨状を見れば一目瞭然よ

<size\=15><color\=#00000000>‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐</color>しっこく<color\=#00000000>‐‐</color>やみ<color\=#00000000>‐‐‐‐‐‐</color></size>\n…じきにこの森も漆黒の闇に沈む\n<size\=15><color\=#00000000>-</color>か<color\=#00000000>-‐‐</color>もの<color\=#00000000>‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐</color></size>\n彼の者たちも動き出す頃合いか

Expected results: \n足跡の大きさや\n\nここの惨状を見れば一目瞭然よ

\n…じきにこの森も漆黒の闇に沈む\n\n彼の者たちも動き出す頃合いか I don't get why this wouldn't work because everything i'm doing matches up with all the scarce examples i could find

Thanks in advance,

FlashlightET avatar Nov 21 '23 23:11 FlashlightET

try: https://regexr.com/ https://stackoverflow.com/questions/1687620/regex-match-everything-but-a-specific-pattern

this might not help you, but I tried at least

xllifi avatar Nov 22 '23 11:11 xllifi

Here is a similar instance I have created:

sr:"^【<color\=#ffff7f>(\S{2,10})</color>】に『<color\=#84c1ff>(\S{2,10})</color>』が侵攻!$"=<color\=#ffff7f>$1</color> 受到 <color\=#84c1ff>$2</color> 的进攻!

\n may not exist as a character in the game, or .* does not match \n, so you should write it into Regex. hope this helps.

heroncrow avatar Nov 28 '23 10:11 heroncrow