aspose file tools
The moose likes Java in General and the fly likes How to validate french chars? (Base on external file name) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to validate french chars? (Base on external file name)" Watch "How to validate french chars? (Base on external file name)" New topic
Author

How to validate french chars? (Base on external file name)

Yaoyuan Fan
Greenhorn

Joined: Jun 02, 2009
Posts: 10
Can anybody advise that how to validate french chars? (chars Base on external file name)
An example would be appreciated!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
What do you mean by "validate"? What would the inputs of this validation be, and what the outputs?


Android appsImageJ pluginsJava web charts
Yaoyuan Fan
Greenhorn

Joined: Jun 02, 2009
Posts: 10
Actually, my purpose is to validate file name with allowing only English(a-Z), underscore “_”, dot “.” , French chars(a-Z, is it?) and numeric char(0-9).

Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

So the question is "What characters can appear in French words", is it?
Yaoyuan Fan
Greenhorn

Joined: Jun 02, 2009
Posts: 10
the question is how to check if the file name only contain English character, underscore “_”, dot “.” , French characters, and numeric char(0-9).

A simple example is appreciated!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

I see, so you know the list of characters you want to accept. In that case a simple regex which only accepts those characters might be the best way to do this.

(I don't know why you would want to apply such a limitation to the file name, but that's a separate question.)
Yaoyuan Fan
Greenhorn

Joined: Jun 02, 2009
Posts: 10
Paul Clapham wrote:I see, so you know the list of characters you want to accept. In that case a simple regex which only accepts those characters might be the best way to do this.

(I don't know why you would want to apply such a limitation to the file name, but that's a separate question.)


What exactly do I need to do?
Do I need to collect all valid chars then check if every input match one in collection?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

I don't understand the question. Are you saying that you don't know how to use a regex, or that you don't know how to write a regex for this particular problem, or that you want to use something else instead, or what?
Yaoyuan Fan
Greenhorn

Joined: Jun 02, 2009
Posts: 10
Paul Clapham wrote:I don't understand the question. Are you saying that you don't know how to use a regex, or that you don't know how to write a regex for this particular problem, or that you want to use something else instead, or what?


I know how to deal with numeric and English chars in Regex(just input A-Z, 0-9, into my expression pattern), how about those french characters?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

You just put them in too. Or did you try it and have a problem? If so, posting details about the problem would be helpful.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to validate french chars? (Base on external file name)
 
Similar Threads
xml
xml
french kiss
The file format is wrong.
Help, How to validate french chars? (Base on external file name)