Problem with regular expressions - preg_match

Hi,

I’m having problems with regular expression searches using preg_match on a form.

if(!preg_match(’/((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)/’, $var))

In the previous case, scriptcase modifies the value [T] by $this->sc_temp_T, I suposse is being in square brackets and matching some internal temporary type variable, it also happens to me with the [KLM] value returns $this->sc_temp_KLM but in this [A-Z] or [A-Z0-9] does not pass.

Some help?

Is a bug?

Thanks

I answer myself: we use ‘’ in front of the brackets that it interprets as variables. if(!preg_match(’/((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)/’, $var))