• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody advise that how to validate french chars? (chars Base on external file name)
An example would be appreciated!
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "validate"? What would the inputs of this validation be, and what the outputs?
 
Yaoyuan Fan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22846
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the question is "What characters can appear in French words", is it?
 
Yaoyuan Fan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22846
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22846
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22846
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!