[SNIPPET] Force UPPER CASE for ROMAN NUMERALS

All about user-defined episode / movie / file name format expressions
Post Reply
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[SNIPPET] Force UPPER CASE for ROMAN NUMERALS

Post by rednoah »

If you want to force roman numerals to upper-case characters then a simple regex-replace will do the just just fine.

Code: Select all

{n.replaceAll(/\b(?i:I|II|III|IV|V|VI|VII|VIII|IX|X)\b/, { it.upper() })}
\b ... word boundary (i.e. non-character like blank)
?i ... case-insensitive group
:idea: Please read the FAQ and How to Request Help.
Post Reply