English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
يتم مطابقة حقل CANON_EQ في Pattern فقط عندما تكون الحروف متطابقة. عند استخدام هذه القيمة كـcompile()
عندما يكون العلامة المميزة للطريقة، يتم مطابقة زوج من الحروف، ويتم مطابقة الزوجين فقط إذا كانت التقسيمات النموذجية الكاملة متطابقة.
تقسيم النص هو أحد أشكال تنظيم النصوص Unicode
import java.util.regex.Matcher; import java.util.regex.Pattern; public class CANON_EQ_Example { public static void main( String args[] ) { String regex = "ḃ"; //تجميع التعبير النصي العادي Pattern pattern = Pattern.compile(regex, Pattern.CANON_EQ); //البحث عن عناصر التطابق Matcher matcher = pattern.matcher("\u1E03"); if(matcher.matches()) { System.out.println("تم العثور على تطابق"); else { System.out.println("لم يتم العثور على تطابق"); System.out.println(ele + "ليس تطابقًا مع" + regex); System.out.println(ele + "ليس تطابقًا مع" + regex); System.out.println(ele + "ليس تطابقًا مع" + regex);
}
تم العثور على تطابق
import java.util.regex.Matcher; import java.util.regex.Pattern; public class CANON_EQ_Example { public static void main( String args[] ) { String regex = "a\u030A"; //تجميع التعبير النصي العادي Pattern pattern = Pattern.compile(regex, Pattern.CANON_EQ); //البحث عن عناصر التطابق String[] input = {"\u00E5", "a\u0311", "a\u0325", "a\u030A", "a\u1E03", "a\uFB03"}; for (String ele : input) { Matcher matcher = pattern.matcher(ele); if(matcher.matches()) { System.out.println(ele + "هو تطابق مع" + regex); else { } System.out.println(ele + "ليس تطابقًا مع" + regex); System.out.println(ele + "ليس تطابقًا مع" + regex); System.out.println(ele + "ليس تطابقًا مع" + regex); System.out.println(ele + "ليس تطابقًا مع" + regex);
}
نتائج الإخراج a? هو تطابق مع a? a? هو تطابق مع a? å هو تطابق مع a? a? هو تطابق مع a? a? هو تطابق مع a?