Is it possible to do validation with regular expressions in a localized web application environment?

Is it possible to do client side validation in a localized web application environment?

I've only seen regular expressions written in English, can they be written for other languages? Would the regular expressions have to be changed based on the language chosen by an end user or is it possible to use just 1?

Are there any tools/frameworks to help with this?


Previous answer was good, but it's not clear to me that it answered the question. For that matter, I don't really understand the question. If you're asking whether JavaScript regular expressions are independent of language, then the answer is yes, they are just looking at characters in a string. But obviously the things you're looking for with those regular expressions (words, numbers, phone numbers, dates, etc.) would presumably vary with language and locale. So you may be able to construct a universal regex that works to validate all phone numbers, for example, but it's probably unlikely, and in any case there may be cases where a valid number in one context is invalid in another. You're better off to create language-specific regular expressions used for validation just as you would create language specific strings. Does that answer your question?

Need Your Help

First create table structure or objects

java hibernate jpa

I got to know that using JPA ,I can create database structure based on my anotaed set objects.

Python - Iterate Tree with Generator in Depth-First order

python recursion generator yield depth-first-search

I am trying to do a DFS on a binary tree. The tree is valid. The function itself works when the yield is replaced with a print (when it is not a generator).