Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

regular expression

Name: Anonymous 2007-10-26 20:08

Guys, how do I write a regex that makes sure that the WHOLE string has ONLY the following characters: A-Za-z01-9'"., etc.

What I wrote was...
/^[\d\w\s'"\.,]+$/
But it doesn't work when I try "test's testing" but works without 's... weird...

inb4 noob

Name: Anonymous 2007-10-26 20:17

noob

Name: Anonymous 2007-10-26 20:19

in after noob
inb4 answer

Name: Anonymous 2007-10-26 20:19

>>3
answer

Name: Anonymous 2007-10-26 20:20

in after answer

/thread

Name: Anonymous 2007-10-26 22:06

oh lord

HOW DID I USED SPECIAL CHARACTERS IN EXPRESSIONS?

fucking saged for something that should have been learned in fucking programming 101.

I mean seriously.

Name: Anonymous 2007-10-26 22:28

read the book. seriously.

Name: Anonymous 2007-10-26 22:47


int is_proper(char *s) {
  while(*s>='a'&&*s<='z'||etc) s++;
  return !*s;
}

Name: Anonymous 2011-11-10 11:29

old thread is old

Don't change these.
Name: Email:
Entire Thread Thread List