locked
Validate form input - Japanese RRS feed

  • Question

  • User647540711 posted

     I've searched for several hours and haven't come up with a reference - or even many discussions - of how to go about validating Japanese names, addresses, etc. When I lived in Japan websites, atm's etc. required such info to be entered with the roman alphabet but I've seen some websites that are allowing Kanji/Hiragana/Katakana. I haven't tested many of them for validation but one that I did test (after looking at the page source and discovering no client-side validation) allowed me to put this in the name field: J*=123*go^ Neat!

    Any pointers/references? Thanks

    Monday, August 16, 2010 7:23 PM

Answers

  • User647540711 posted

    Pretty underwhelming response :-)

    I figured it out (maybe - tests OK so far). Works with unicode ranges. Specifically:

    Kanji: u4E00-\u9FA5
    Hiragana: \u3040-\u309F
    Katakana: \u30A0-\u30FF

    So:

    ValidationExpression="^[-a-zA-Z0-9\u4E00-\u9FA5\u3040-\u309F\u30A0-\u30FF _.]*$"

    Allows English alpha and digits plus a dash, space, underscore and period and the three Japanese character sets.

    Any suggestions for improvement will be appreciated.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 6, 2011 2:54 PM