English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
تفعيل دعم انحناء الحروف Unicode.
عند استخدام هذا القيمة مع علامة CASE_INSENSITIVE كعلامة للقيمة التي يتم استخدامها في طريقة compile()، وإذا تم البحث باستخدام تعبير النصي عن رموز Unicode، فإن رموز Unicode في كلا الحالتين ستتم مطابقتها.
استيراد java.util.regex.Matcher; استيراد java.util.regex.Pattern; public class UNICODE_CASE_Example {}} public static void main(String args[]) { String regex = "\u00de"; //Compiling the regular expression Pattern pattern = Pattern.compile(regex, Pattern.UNICODE_CASE|Pattern.CASE_INSENSITIVE); //Retrieving the matcher object String str[] = {"\u00de", "\u00fe", "\u00ee", "\u00ce"}; for(String ele : str) { Matcher matcher = pattern.matcher(ele); if(matcher.matches()) { System.out.println(ele + " is a match for " + regex); } System.out.println(ele + " is not a match for " + regex); } } } }
نتائج الخروج
Þ is a match for Þ þ is a match for Þ î is not a match for Þ Î is not a match for Þ