• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.util.regex.Pattern

 
Dave Jones
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I want to check my input string that it contains only the characters:
a-z, A-Z , 0-9, [,],{,},/,,, ,_,

I was told I can use a Pattern , but when looking it up, I didn't find what I need, can anyone shed some light here ?
Thanks
p.s - I know I could do it the hard way by running a char char check, but I want to avoid that way
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


/* Edit */
I really need another cup of coffee...
[ April 07, 2005: Message edited by: Steve Morrow ]
 
Ryan McGuire
Ranch Hand
Posts: 1073
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dave Jones:

I was told I can use a Pattern , but when looking it up, I didn't find what I need, can anyone shed some light here ?
Thanks


Are you saying you didn't find the Pattern javadoc? Try here.

For a little sample code that uses Pattern, look this discussion.

Does that clear it up?

Ryan
[ April 07, 2005: Message edited by: Ryan McGuire ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic