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
  • 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.
Children