Package com.google.gwt.regexp.shared

Examples of com.google.gwt.regexp.shared.RegExp


   }
  
   private void validateAppName()
   {
      String app = appName.getText();
      RegExp validReg = RegExp.compile("^[A-Za-z0-9_-]{4,63}$");
      setAppNameValid(validReg.test(app));
   }
View Full Code Here


   // offset.
   public final String getOffsetParseError(int offsetline)
   {
      String error = getParseError();
      String lineRegex = "line (\\d+),";
      RegExp reg = RegExp.compile(lineRegex);
      MatchResult result = reg.exec(error);
      if (result == null || result.getGroupCount() < 2)
         return getParseError();
      else
      {
         Integer newLine = Integer.parseInt(result.getGroup(1)) + offsetline;
View Full Code Here

      public String getIndent()
      {
         // consider the list element indicator (-) to be part of the node's
         // indentation, to prevent list continuations from being treated as
         // sibling nodes
         RegExp whitespace = RegExp.compile("^\\s*-?\\s*");
         MatchResult result = whitespace.exec(yamlLine);
         if (result == null)
            return "";
         else
            return result.getGroup(0);
      }
View Full Code Here

      public YamlTreeNode parent = null;
      public List<YamlTreeNode> children = new ArrayList<YamlTreeNode>();
     
      private String getKey(String line)
      {
         RegExp keyReg = RegExp.compile("^\\s*([^:]+):");
         MatchResult result = keyReg.exec(line);
         if (result == null)
            return "";
          else
            return result.getGroup(1);
      }
View Full Code Here

  
   @Override
   public void onConsoleWriteInput(ConsoleWriteInputEvent event)
   {
      // when a file is sourced, replay all the breakpoints in the file.
      RegExp sourceExp = RegExp.compile("source(.with.encoding)?\\('([^']*)'.*");
      MatchResult fileMatch = sourceExp.exec(event.getInput());
      if (fileMatch == null || fileMatch.getGroupCount() == 0)
      {
         return;
      }     
      String path = FilePathUtils.normalizePath(
View Full Code Here

    if (userAgent.contains("Chrome")) {
      return false; // All versions of Chrome are upsupported
    }

    if (userAgent.contains("Firefox")) {
      RegExp versionRegExp = RegExp.compile("Firefox[\\/\\s](\\d+)\\.\\d+", "ig");
      MatchResult result = versionRegExp.exec(userAgent);
      if (result != null) {
        int version = Integer.parseInt(result.getGroup(1));
        return version < 7; // Resize is unsupported for Firefox 7 and newer.
      }
    }
View Full Code Here

  public void testSetTabIndex() {
    // Skip this test on Safari 3 because it does not support focusable divs.
    String userAgent = Window.Navigator.getUserAgent();
    if (userAgent.contains("Safari")) {
      RegExp versionRegExp = RegExp.compile("Version/[0-3]", "ig");
      MatchResult result = versionRegExp.exec(userAgent);
      if (result != null && result.getGroupCount() > 0) {
        return;
      }
    }
View Full Code Here

  /**
   * Checks to query string and retrieves/stores all defined prefixes in an object variable
   */
  public HashMap<String, Prefix> getPrefixHashMap() {
    HashMap<String, Prefix> queryPrefixes = new HashMap<String, Prefix>();
    RegExp regExp = RegExp.compile(PREFIX_PATTERN, "gm");
    while (true) {
      MatchResult matcher = regExp.exec(getQuery());
      if (matcher == null)
        break;
      queryPrefixes.put(matcher.getGroup(2), new Prefix(matcher.getGroup(1), matcher.getGroup(2)));
    }
    return queryPrefixes;
View Full Code Here

   * Check whether visitor is a crawler. This way we can avoid the google
   * screenshot containing lots of popups
   */
  public static boolean isCrawler() {
    String userAgent = JsMethods.getUserAgent();
    RegExp regExp = RegExp.compile(".*(" + CRAWL_USER_AGENTS + ").*");
    MatchResult matcher = regExp.exec(userAgent);
    boolean matchFound = (matcher != null);
    return matchFound;
  }
View Full Code Here

    return baseUrl + (argsString.length() > 0 ? "?" + argsString : "");

  }

  public static boolean validUrl(String url) {
    RegExp pattern = RegExp.compile("^(https?:\\/\\/)?" + // protocol
        "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain
                                    // name
        "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
        "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
        "(\\?[;&a-z\\d%_.~+=-]*)?" + // query string
        "(\\#[-a-z\\d_]*)?$", "i");
    return pattern.test(url);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.regexp.shared.RegExp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.