Relative Content

Tag Archive for phppreg-match

Match a number representing weight and its measurement unit

I have a bunch of values representing weight… Some of them are ambiguous, like combining weight and external dimensions of the package, and some don’t contain the measurement unit. What I want is to take those ambiguous values out.

PHP preg_match wierd problem with symbols in Pattern

I am trying to match all characters except the ones mentioned in the exclusion group, the symbol in the subject “some–text” is not a Hyphen / Minus sign its an En Dash Unicode Character “–” (U+2013)

Trying to use preg_match for single word or no spaces, to combat spam

I have a form I continue to build on, so that I can keep spam from being sent through. So far, pretty good – in that the only thing now still getting through are single groups of random letters. I have code that kills a send if there are three or more multiple capitals, but would prefer code that either dies on only one nonsense word OR dies if there is no space between at least three words.