/** * Initialize regular expressions used in unescaping. This method will be * invoked automatically the first time a string is unescaped. */ public static boolean initializeUnescapePattern() { if (paternIsInitialized == true) { return true; } synchronized (unescapeInitLockObject) { if (paternIsInitialized == true) { return true; } try { unescapePattern = Pattern.compile(unicodeUnescapeMatchExpression); } catch (PatternSyntaxException pse) { /* * the pattern is compiled from a final string, so this * exception should never be thrown */ System.err.println("Imposible error: " + "static final regular expression pattern " + "failed to compile. Exception: " + pse.toString()); return false; } paternIsInitialized = true; } return true; }
private void jTextFieldGrepExpressionFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldGrepExpressionFocusLost try { String regex = jTextFieldGrepExpression.getText(); Pattern.compile(regex); currentIssue.grepExpression = regex; } catch(PatternSyntaxException ex) { JOptionPane.showMessageDialog(replicatorPanel, ex.toString(), BurpExtender.name, JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_jTextFieldGrepExpressionFocusLost
/** * Initialize regular expressions used in unescaping. This method will be * invoked automatically the first time a string is unescaped. */ public static boolean initializeUnescapePattern() { if (paternIsInitialized == true) { return true; } synchronized (unescapeInitLockObject) { if (paternIsInitialized == true) { return true; } try { unescapePattern = Pattern.compile(unicodeUnescapeMatchExpression); } catch (PatternSyntaxException pse) { /* * the pattern is compiled from a final string, so this * exception should never be thrown */ System.err.println("Imposible error: " + "static final regular expression pattern " + "failed to compile. Exception: " + pse.toString()); return false; } paternIsInitialized = true; } return true; }
/** * Sets the url-pattern */ public void addURLPattern(String pattern) { String regexpPattern = UrlMap.urlPatternToRegexpPattern(pattern); int flags = (CauchoSystem.isCaseInsensitive() ? Pattern.CASE_INSENSITIVE : 0); try { _regexp = Pattern.compile(regexpPattern, flags); } catch (PatternSyntaxException e) { log.log(Level.WARNING, e.toString(), e); } }
out.println(e.toString()); } finally { if (doc != null) {
public void once() throws MessagingException, IOException { for(int i=0;i<mailSources.size();i++) { MailSource mailSource = mailSources.get(i); mailSource.getMailDestination().startup(); logger.debug("once() start"); final MailFlowJob mfj = new MailFlowJob(); try { mfj.setPattern(folderPattern == null ? null : Pattern.compile(folderPattern)); } catch (final PatternSyntaxException e) { logger.error("folderpattern is invalid due to {}", e, e.toString()); } mfj.setMailSource(mailSource); mfj.execute(); logger.debug("once() end"); } }
compiledGlobRegex = Pattern.compile(globRegex); } catch (PatternSyntaxException e) { log.log(Level.FINE, e.toString(), e);
pse.toString(),// $NON-NLS-1$ JMeterUtils.getResString("error_title"), // $NON-NLS-1$ JOptionPane.WARNING_MESSAGE);
String title = s_stringMgr.getString("syntax.SquirrelRSyntaxSearchEngine.RegExErrTitle", pse.toString()); JOptionPane.showMessageDialog(_dialog.getDialog(), msg, title, JOptionPane.ERROR_MESSAGE);
String title = s_stringMgr.getString("syntax.SquirrelRSyntaxSearchEngine.RegExErrTitle", pse.toString()); JOptionPane.showMessageDialog(_dialog.getDialog(), msg, title, JOptionPane.ERROR_MESSAGE);