From: <jbo...@li...> - 2005-08-12 19:26:07
|
Author: ral...@jb... Date: 2005-08-12 15:24:46 -0400 (Fri, 12 Aug 2005) New Revision: 836 Modified: trunk/forge/portal-extensions/forge-wiki/src/java/org/jboss/wiki/plugins/HTMLTranslator.java Log: updated regex for links Modified: trunk/forge/portal-extensions/forge-wiki/src/java/org/jboss/wiki/plugins/HTMLTranslator.java =================================================================== --- trunk/forge/portal-extensions/forge-wiki/src/java/org/jboss/wiki/plugins/HTMLTranslator.java 2005-08-12 15:01:58 UTC (rev 835) +++ trunk/forge/portal-extensions/forge-wiki/src/java/org/jboss/wiki/plugins/HTMLTranslator.java 2005-08-12 19:24:46 UTC (rev 836) @@ -50,8 +50,8 @@ public String parseLinks(String text, String actionURL) { String translatedContent = text; String link;// = ""; - String href1regex = "\\[.+\\|.+\\]"; - String href2regex = "\\[.+\\]"; + String href1regex = "\\[[\\p{Graph}\\p{Blank}&&[^\\[\\]]]+\\|[[\\p{Alnum}\\/\\/\\,\\.\\|\\:\\;\\+\\=\\&]\\p{Blank}]+\\]";//"^(\\[\\p{Alnum}&&\\|&&\\p{Alnum}&&\\])$"; + String href2regex = "\\[\\p{Graph}+\\]"; Pattern tLinks = Pattern.compile(href1regex); Pattern links = Pattern.compile(href2regex); Matcher textlinks = tLinks.matcher(text); |