special character matching |
[eluser]xwero[/eluser]
I'm adding some validation rules to my validate library and i wanted the string validation to recognize other characters than only the alpha_numeric characters so i've added these nice strings Code: $special_vowels = "ÀÁÂÃÄÅÆÈÉÊËÌÍÎÏÒÓÔÕÖØÙÚÛÜàáâãäåæèéêëìíîïðòóôõöøùúûüýÿĀāĂ㥹ĒēĔĕĖėĘęĚěĨĩĪīĬĭĮįıIJijĴĵŌōŎŏŐőŒœŨũŪūŬŭŮůŰűŲųŶŷŸƠơƯưǍǎǏǐǑǒǓǔǕǖǗǘǚǛǜǺǻǼǽǾǿ"; If people want to add characters please do. I'm not sure if every character can be read on all computers. If there an easier way to match these characters, please tell me.
[eluser]xwero[/eluser]
I've just did some research for the preg_x functions and it appears you should be able to do something like this (php.net) Code: preg_match('/[\pL\p]+/u',$str); Quote:Matching characters by Unicode property is not fast, because PCRE has to search a structure that contains data for over fifteen thousand characters. That is why the traditional escape sequences such as \d and \w do not use Unicode properties in PCRE. |
Welcome Guest, Not a member yet? Register Sign In |