• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there a regular expression i can use to search for bad characters in form submisssion  RSS feed

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i created a form to gather client data... I am looking for a regex that i can use to test the data i am collecting against characters that hackers use... I only want alpha numeric and normal punctuation...

something like
var specials = new RegExp(/^[a-zA-Z_0-9]$/);

is this worth the effort.

is there a better regex i can use?
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Christopher Whu wrote:i created a form to gather client data... I am looking for a regex that i can use to test the data i am collecting against characters that hackers use... I only want alpha numeric and normal punctuation...

something like
var specials = new RegExp(/^[a-zA-Z_0-9]$/);

is this worth the effort.

is there a better regex i can use?



you can use form validation and use that to weed out sql injection and other hacker tactics
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!