chrisguk;10999484 wrote:Anyone know how I can convert the following to preg_match?
You can convert pretty much any ereg to preg by inserting starting and ending delimiter. It's your choice from among a heap of characters, but # and / are common. Thus, if you have
ereg('[a-z]')
you'd use
preg('#[a-z]#')
.
Next up is including regexp options after the ending delimiter. In your case, you are using eregi, where the trailing 'i' stands for "case insensitive" match. Thus, by reading the documentation for preg, you'd realize that you'd need
preg('#pattern#i');
On the other hand, you are allready manually inserting both a-z and A-Z in all character classes, so the i option would change nothing in this case.