Forum Moderators: coopster & phranque

Message Too Old, No Replies

how do use split with + as the seperator

         

bleak26

5:11 pm on Dec 23, 2003 (gmt 0)

10+ Year Member



how do use split with + as the seperator, i have tried the following code,but cannot get it to work .

when i try this
@pizzatypeandvalue = split (/"+"/,$element );
i get no error,but page just sits and waits and nothing is returned to the browser until it time outs.

when i try this
@pizzatypeandvalue = split (/+/,$element );
i get internal server error and when i run the file in shell it tells me,

"Quantifier follows nothing in regex; marked by <-- HERE in m/+ <-- HERE / at ops.cgi line 273."

when i try this
@pizzatypeandvalue = split (//+/,$element );
i get no error,but page just sits and waits and nothing is returned to the browser until it time outs.

Please can you help

coopster

5:26 pm on Dec 23, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, bleak26!

The plus sign (+) has special meaning in regular expressions therefore you need to escape it. Try this:


@pizzatypeandvalue = split (/\+/,$element);