import java.util.Map;
import java.util.Vector;
+import com.stevesoft.pat.Regex;
+
/**
* A helper class to parse URL Link strings taken from applet parameters or
* jalview properties file using the com.stevesoft.pat.Regex implementation.
{
if (regexReplace != null)
{
- com.stevesoft.pat.Regex rg = com.stevesoft.pat.Regex
- .perlCode("/" + regexReplace + "/");
+ Regex rg = Platform.newRegexPerl("/" + regexReplace + "/");
if (rg.search(idstring))
{
int ns = rg.numSubs();
{
// Extract Regex and suffix
urlSuffix = link.substring(p + endDelimiter.length());
- regexReplace = link.substring(sqidPos + startLength, p);
- try
- {
- com.stevesoft.pat.Regex rg = com.stevesoft.pat.Regex
- .perlCode("/" + regexReplace + "/");
- if (rg == null)
- {
- invalidMessage = "Invalid Regular Expression : '" + regexReplace
- + "'\n";
- }
- } catch (Exception e)
- {
- invalidMessage = "Invalid Regular Expression : '" + regexReplace
- + "'\n";
- }
+ testRegexPerl(
+ regexReplace = link.substring(sqidPos + startLength, p));
}
else
{
return p;
}
+ private void testRegexPerl(String r)
+ {
+ Regex rg = null;
+ try
+ {
+ rg = Platform.newRegexPerl("/" + r + "/");
+ } catch (Exception e)
+ {
+ }
+ if (rg == null)
+ {
+ invalidMessage = "Invalid Regular Expression : '" + r + "'\n";
+ }
+ }
+
/**
* Create a set of URL links for a sequence
*