homepage Welcome to WebmasterWorld Guest from 54.243.12.156
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Form Regex
form regex to exclude "/" text character
colintho




msg:430032
 1:52 pm on May 27, 2005 (gmt 0)

Not sure if this is the right place for this post?

How do I use "form regex" to exclude a text character, forward slash "/" from text entered into a database field?

 

lexipixel




msg:430033
 5:18 pm on May 27, 2005 (gmt 0)

More likely what you want to do is substitute the '/' character using a $var =~ s///; construct after parsing the form data.

EXAMPLE #1:

#
$datastring = 'this has a / in it';
$datastring =~ s/\// /g;
#
print $datastring;
#

SHOULD PRODUCE OUTPUT: this has a in it

~~~ OR ~~~~

EXAMPLE #2:

#
$datastring = 'this has a / in it';
$datastring =~ s/\//_/g;
#
print $datastring;
#

SHOULD PRODUCE OUTPUT: this has a _ in it

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved