Regex for Chinese Numbers

In a scenario of source/target = English to Simp Chin, is there a way to leverage Regex so that numbers above 10,000 in English are properly rendered in Chinese?

Parents Reply Children
  • Hi Susan,

    I just translate it the old-fashioned way without using any method(s) to automate the process. Now that you mention it, it makes me think there may be a faster way to do it--I would love to know:)

    Chunyi
  • I'm a beginner at regex as well, so this is very messy, but it works. I had installed Regex Match Auto-suggest plugin, and then I entered such strings:

    ([0-9]{1})([0-9]{1})([,\s])([0-9]{3}) $1,$2$4
    ([0-9]{1})([,\s])([0-9]{3}) $1$3
    ([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1,$2$4
    ([0-9]{1})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1$3,$4$6
    ([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1$3,$4$6
    ([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1,$2$4,$5$7
    ([0-9]{1})([,\s])([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3}) $1$3,$4$6$2$7$9
    ([0-9]{1})([,\s])([0-9]{3})([.,]([0-9]*)) $1$3$4
    ([0-9]{1})([0-9]{1})([,\s])([0-9]{3})([.,]([0-9]*)) $1,$2$4$5
    ([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1,$2$4$5
    ([0-9]{1})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1$3,$4$6$7
    ([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1$3,$4$6$7
    ([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})([,.]([0-9]*)) $1,$2$4,$5$7$8
    ([0-9]{1})([,\s])([0-9]{1})([0-9]{2})([,\s])([0-9]{2})([0-9]{1})([,\s])([0-9]{3})(.([0-9]*)) $1$3,$4$6,$7$9$10

    But it only works INTO Chinese from English and Polish up to: 0,000,000,000.00->00,0000,0000.00 . I do not know how to make it work for all numbers or how to make it use the 0.000万 method. Making it work the over way round would require a new set of strings that I have not written yet.
  • I guess it gets tricky unless we know the patterns. So far we know this one:

    100万

    This equals 100 x 10,000 or 1,000,000

    But what others are there? For example, how would you write these numbers?

    3
    17
    287
    3,876
    43,985
    520,456
    1,456,768
    23,456,102
    327,657,105
    9,436,890,111

    What are the rules for writing numbers in Chinese and can they be easily transformed? I didn't even touch decimals but I guess this would add more complexity?

    Regards

    Paul

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub