AZJIO Posted July 11, 2012 Share Posted July 11, 2012 How do I make are not case sensitive in regular expression for the local languages (Unicode)?In other words, need to get a range of [A-Za-z] for the local language.Need to find file names are not case sensitive, using the local language.$sMask = 'Hello' $sLocale = '[A-Za-z]' MsgBox(0, 'Сообщение', __FO_UserLocale($sMask, $sLocale)) Func __FO_UserLocale($sMask, $sLocale) Local $i, $s, $tmp $sLocale=StringRegExpReplace($sMask,'[^'&$sLocale&']', '') ; получаем строку с повторами $tmp = StringLen($sLocale) For $i = 1 To $tmp $s = StringMid($sLocale, $i, 1) If $s Then ; если пустая строка, значит поиск закончился If StringInStr($sLocale, $s, 0, 2, $i) Then $sLocale = $s&StringReplace($sLocale, $s, '') ; если символ повторяется, то удаляем все, дописывая его в начало списка EndIf Else ExitLoop EndIf Next If $sLocale Then $tmp = StringSplit($sLocale, '') For $i = 1 To $tmp[0] $sMask = StringReplace($sMask, $tmp[$i], '['&StringUpper($tmp[$i])&StringLower($tmp[$i])&']') Next EndIf Return $sMask EndFunc ;==>__FO_UserLocale My other projects or all Link to comment Share on other sites More sharing options...
AZJIO Posted July 13, 2012 Author Share Posted July 13, 2012 (edited) Why is the modifier (?iu) produces an error? Why is not supported? Edited July 13, 2012 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now