Oct 17, 2007 #1 justride Programmer Jan 9, 2004 251 US Does anybody know the pattern to escape special characters if they arent already escaped? for example, to escape TEST1&TEST2 but not TEST1 & TEST2 Thanks
Does anybody know the pattern to escape special characters if they arent already escaped? for example, to escape TEST1&TEST2 but not TEST1 & TEST2 Thanks
Oct 17, 2007 1 #2 jaxtell Programmer Sep 11, 2007 349 US try this Code: String stuff = "&&&&"; stuff = java.util.regex.Pattern.compile("&(?!amp;)", java.util.regex.Pattern.CASE_INSENSITIVE).matcher(stuff).replaceAll("&"); Upvote 0 Downvote
try this Code: String stuff = "&&&&"; stuff = java.util.regex.Pattern.compile("&(?!amp;)", java.util.regex.Pattern.CASE_INSENSITIVE).matcher(stuff).replaceAll("&");
Oct 17, 2007 Thread starter #3 justride Programmer Jan 9, 2004 251 US Thanks a ton, so this stating any occurence of & followed by the NOT of 1 occurence of amp; (case insensitive) ? Thanks so much! Upvote 0 Downvote
Thanks a ton, so this stating any occurence of & followed by the NOT of 1 occurence of amp; (case insensitive) ? Thanks so much!