<BR>to split the multiple entries.
EX:
field:data¦color:pink<BR>blue<BR>red<BR>¦field:data
Problem is - I need to regulate everything going into that field - only numerals, alphas, and white space is okay.
Every time I try to regex the field input, and convert to lower case, I have to take into consideration the
<BR>splitting the fields when the data is actually written to the database, or retrieved for later editing.
Nothing works. Granted, I'm bad at regexing, but my patience with errors is running thin, also.
Need help.
match this "red<br>green<BR>etc<br>" or "red" or even " "
but
do not match this "red<br>green<nastytag><br>" or "¦some hack$> code"
Heres the pattern I used [perl]/^(<br>¦[\w\s]*)*$/i[/perl]
Don't copy and paste this as the ¦ symbol gets converted somewhere... typing it will work though.
Gethan
if ($in{'color'} =~ /[^\w-\s\<BR>]/) {
print "Knock that off and quit entering a bunch of crap";
} And it seemed to be working okay. I forgot I allowed hypens, too. duh.
Now I check back and looks like that was pretty much right. Every now and then I surprise myself.
<added>but you had the order right! NOW I see </added>
Yours worked, too, using
unlessinstead of
if.
I spent three days fixing hundreds or corrupted lines because the 'user' decided to write War & Peace in the freaking form fields and use every punctuation symbol known to man.
I wrote some rather hostile error messages. I am - without a doubt - the error message queen. (Both in creating scripting errors and writing the actual messages.)