Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-02-24, 03:13 PM   #13
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
for regexp, if you wanted the first character to be alphanumeric, non-space

^[a-zA-Z0-9][a-zA-Z0-9 ]+$

of course, that will allow an ending space character, which could eliminate with something like:

^[a-zA-Z0-9][a-zA-Z0-9 ]+[a-zA-Z0-9]$

however, that still allows multi-space runs in the middle.

One thing I always tell my guys -- validate input, don't try and fix it. Running search and replace to destroy invalid string or url encoding, etc can be avoided with a decent regexp.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:34 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc