A small mistake in a regular expression caused connection to reset – (.+)+

by Yang Yang on December 4, 2010

Was doing something with a regular expression and very oddly the connection keeps being reset every time I refresh the web page.

I tried to narrow down the problematic line by removing the code in functional chunks. Finally it comes down to a preg_match() instance with a small bit in the regular expression that’s accidentally and wrongly typed in caught my attention:

(.+)+

Got rid of the second plus sign:

(.+)

And it’s all right.

Comments on this entry are closed.

Previous post:

Next post: