when i give this text in pattern it’s gives exception.
Pattern newRegex = Pattern.compile(“The parties shall comply with all applicable laws and regulations governing the privacy and security of patient information, including, but not limited to, the GDPR Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data), as applicable, and any other laws, rules, or regulations relating to the processing of personal data, the maintenance, the use, the transmission or other activity concerning patient records and the confidentiality of personal and medical data”, Pattern.CASE_INSENSITIVE);
The exception is like ,
Exception in thread “main” java.util.regex.PatternSyntaxException: Unmatched closing ‘)’ near index 373
The parties shall comply with all applicable laws and regulations governing the privacy and security of patient information, including, but not limited to, the GDPR Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data), as applicable, and any other laws, rules, or regulations relating to the processing of personal data, the maintenance, the use, the transmission or other activity concerning patient records and the confidentiality of personal and medical data
^
at java.util.regex.Pattern.error(Pattern.java:1957)
at java.util.regex.Pattern.compile(Pattern.java:1702)
at java.util.regex.Pattern.(Pattern.java:1351)
at java.util.regex.Pattern.compile(Pattern.java:1054)
at FindAndHighlightText.main(FindAndHighlightText.java:56)