copyright: hololive hololive_english
character: mori_calliope takanashi_kiara takanashi_kiara_(phoenix)
artist: xu_chin-wen
species:
meta: web
I want to select every word after eg:character:
so i can put eg:character:
behind every selection,
character:
mori_calliopecharacter:
takanashi_kiarachararcter:
takanashi_kiara_(phoenix)
the closest thing i got is
(?<=(\w*):\s*\S*\s.*)(?<=\s)(?=\S)
which works properly but it breaks when there is a single entry on eg:character: something
or when its empty
i would be really thankfull if someone would help
You should install PyPi regex module and use
See the regex demo. Details:
(?<=(\w+):.*)
- a positive lookbehind that matches a location that is immediately preceded with any word (captured into Group 1) followed by a:
char and then any zero or more chars other than line break chars as many as possible (?<=\s)` - a positive lookbehind that matches a location that is immediately preceded with a whitespace char(?=\S)
- a positive lookahead that matches a location that is immediately followed with a non-whitespace char.See the Python demo:
Output: