answersLogoWhite

0


Best Answer

If you know the associated numeric values for the Japanese characters, the associated regular expression becomes relatively simple.

If you look at: http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml you will see a table for all the Japanese character unicode values, so if you just want to check for the Hiragana/Katakana alphabets, your regex becomes

[\u3041 - \u309F]* | [\u30A0 - \u30FF]*

note: perl and pcre do not support \u, instead use \x{####}, also this regex will only identify whether some string has a regex already contained within it. It does not also check for Kanji characters

You may also find http://www.regular-expressions.info/unicode.html useful.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you validate Japanese characters using regular expressions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is regular expressions?

In programming, a regular expression is an expression that explains a pattern for a string. A string matches a regular expression if that string follows the pattern of that regular expression. For example, you may want to create an account system, allowing usernames to only have uppercase and lowercase letters, and numbers. While a user is registering, you can check their desired username against a regular expression involving only alphanumeric characters (A-Z, a-z, 0-9). If it matches, then the username is valid to your requests. If it does not, the user has put in a character that does not follow the pattern of the regular expression. In regular expressions, you can match certain characters, match a certain quanity of characters, match the casing of characters (or just ignore it overall), and plenty more. The syntax of a regular expression varies throughout every programming language, but Perl is often used due to its wide variety of options. Perl is also incorporated into many web languages, such as PHP, making regular expressions less of a hassle. This is an example of a Perl regular expression, allowing a string with only alphanumeric characters (any character case), and an infinite length (except for a string with no length or no characters, in which the regular expression does not match the string): /^(?i)[a-z0-9]+$/


What is the period used for in Linux regular expressions?

a period means 'any single character'. A period followed by an asterisk means 'zero or more characters'.


What is a regular expression?

In programming, a regular expression is an expression that explains a pattern for a string. A string matches a regular expression if that string follows the pattern of that regular expression. For example, you may want to create an account system, allowing usernames to only have uppercase and lowercase letters, and numbers. While a user is registering, you can check their desired username against a regular expression involving only alphanumeric characters (A-Z, a-z, 0-9). If it matches, then the username is valid to your requests. If it does not, the user has put in a character that does not follow the pattern of the regular expression. In regular expressions, you can match certain characters, match a certain quanity of characters, match the casing of characters (or just ignore it overall), and plenty more. The syntax of a regular expression varies throughout every programming language, but Perl is often used due to its wide variety of options. Perl is also incorporated into many web languages, such as PHP, making regular expressions less of a hassle. This is an example of a Perl regular expression, allowing a string with only alphanumeric characters (any character case), and an infinite length (except for a string with no length or no characters, in which the regular expression does not match the string): /^(?i)[a-z0-9]+$/


Is there is any function or class in Java to check inputed string is valid char sequence and no numbers or any special char are there?

You should probably use regular expressions. For example, the following will check that the String s has only English (Latin) characters in it:boolean hasOnlyLatin = s.matches("^[a-zA-Z]*$");Learning to use regular expressions is scary at first, but worthwhile. See the related links for some information about regular expressions in Java.


What are regular expressions?

py4everybody regular expression answers autograde 11.2


How do you use regular expression in web mining?

Regular expressions can be used to find patterns within data. Beyond that the subject of Regular expressions gets extremely complicated very fast, I suggest you purchase a book on the subject and read it... twice.. http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124/ref=sr_1_1?ie=UTF8&qid=1345423498&sr=8-1&keywords=regular+expressions


How can you use the OR condition in PHP validation in regular expressions?

You use instead of OR


What do you call non regular book characters?

Minor characters


Can you use Perl regular expressions in PHP?

Yes, by using the preg_match() function


What is relation between regular languages finite automaton and regular grammars?

finite automaton is the graphical representation of language and regular grammar is the representation of language in expressions


How do you write in Japanese characters on Microsoft word?

You write the Romaji (romanized) Japanese syllables, and an input method editor converts them to Japanese characters. In the case of homophones, a drop down list lets you choose the appropriate kanji. For example, writing 'ka' will convert to か, but if I choose from the list, I can get: 香、可、火 and so forth.


What is the difference between transition graph and generalized transition graph?

A generalized transition graph is a transition graph whose edges are labeled with regular expressions; otherwise it is same as the usual transition graph. source: Introduction to Formal Languages and Automata by Peter Linz , Regular expressions and regular languages, page 81