Examples of Regexp


Examples of com.NLP.ReqExp.RegExp

  private RegExp regexp;
  private HashSet<String> set;
  public Vocab(){
    set = new HashSet<String>();
    data = new String[8];
    regexp = new RegExp();
    data[0] = "cnn-turk.txt";
    data[1] = "derlem-lisans.txt";
    data[2] = "dunya.txt";
    //data[3] = "hukuki-net.txt";
    data[3] = "milliyet-sondakika.txt";
View Full Code Here

Examples of com.bramosystems.oss.player.util.client.RegExp

     * @return <code>PluginVersion</code> object with specified version numbers.
     * @throws com.bramosystems.oss.player.util.client.RegExp.RegexException if {@code version} is not in the required format
     * @since 1.3
     */
    public static PluginVersion get(String version) throws RegexException {
        RegExp r = RegExp.getRegExp("(\\d+).(\\d+).(\\d+)", "");
        RegExp.RegexResult res = r.exec(version);
        return new PluginVersion(Integer.parseInt(res.getMatch(1)),
                Integer.parseInt(res.getMatch(2)),
                Integer.parseInt(res.getMatch(3)));
    }
View Full Code Here

Examples of com.dragome.html.dom.RegExp

    NodeList childs= fromNode.getChildNodes();

    for (int i= 0; i < childs.getLength(); i++)
    {
      Element child= (Element) childs.item(i);
      boolean isTemplate= new RegExp(aNameRegexp).test(child.getAttribute(DATA_TEMPLATE));

      NamedNodeMap attributes= child.getAttributes();
      for (int j= 0; j < attributes.getLength(); j++)
      {
        Attr item= (Attr) attributes.item(j);
View Full Code Here

Examples of com.foundationdb.sql.pg.YamlTester.Regexp

public class YamlTesterRegexpTest {

    @Test(expected=NullPointerException.class)
    public void testConstructorNull() {
  new Regexp(null);
    }
View Full Code Here

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

      // style attribute must exist and must be quoted properly
      // IE9 does not include style attributes text if their value is not valid
      // we therefore don't expect non-quoted styles like <h1 style=color id="abc"...
      String value = getOuterHTML(elem);
     
      RegExp quotesPattern = RegExp.compile("(?:\".*?\"|\'.*?\'|[^\'\"]+|['\"])", "g"); // g=global: = all-matches
      RegExp stylePattern = RegExp.compile("[\\s]style\\s*="); // e.g. match: <h1 style=
      MatchResult m = quotesPattern.exec(value);

      int i = 0;
      boolean styleFound = false;
      String styleContent = "";
      String nonQ = "";
      while (quotesPattern.getLastIndex() > 0) {
        if (i % 2 == 0) {
          nonQ = m.getGroup(0); // not in quotes - so check
          MatchResult ms = stylePattern.exec(nonQ);
          styleFound = ms.getGroupCount() > 0;
          if (!styleFound && nonQ.indexOf('>') > -1) {
            break; // no more attributes
          }
        } else if (styleFound) {
View Full Code Here

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

      ArrayList<String> nodeNames = new ArrayList<String>();
      ArrayList<String> xmlnsNames = new ArrayList<String>();
      ArrayList<String> xmlnsUris = new ArrayList<String>();
      namespaceBindings = new ArrayList<NamespaceBinding>();
     
      RegExp quotesPattern = RegExp.compile("(?:\"(.|\n)*?\"|\'(.|\n)*?\'|[^\'\"]+|['\"])", "gm"); // g=global: = all-matches m=multiline
      MatchResult m = quotesPattern.exec(value);

      int i = 0;
      String nonQ = "";
      boolean awaitingXmlnsUri = false;
      while (quotesPattern.getLastIndex() > 0) {
       
        if (i % 2 == 0) {
          nonQ = m.getGroup(0); // not in quotes - so check
          StringBuffer sb = new StringBuffer();
          boolean endOfTag = false;
          boolean isName = !(i == 0);// first part is not a name: e.g. \r\n<H1 style="
          int start = 0;
          if (i == 0) {
            start = nonQ.indexOf('<') + 1;          
          }
          for (int x = start; x < nonQ.length(); x++) {
            int[] offsetChar = skipWhitespace(x, nonQ, false);
            int offset = offsetChar[0];
           
            if(offset > 0 && !(isName)) {
              // no whitespace allow in an unquoted value, so we're back on a name
              isName = true;
            }
            char ch = (char)offsetChar[1];
            if (ch == '\0') break;
            if (ch == '=') {
              // part after the '=' is the value, until next whitespace
              isName = false;
              String attName = sb.toString();
             
              if (attName.startsWith("xmlns")) {
                xmlnsNames.add(attName);
                awaitingXmlnsUri = true;
              } else if(attName.length() != 0) {
                nodeNames.add(attName);
                awaitingXmlnsUri = false;
              }

              sb = new StringBuffer();
              continue;
            } else if (ch == '>') {
              endOfTag = true;
              break;
            }
           
            if (isName) {
              sb.append(ch);
            }          
            x += offset;
          } // end for
          if (endOfTag) {
            break;
          }
        } else if (awaitingXmlnsUri) {// ends if i % 2
          xmlnsUris.add(m.getGroup(0));
        }
        i++;
        m = quotesPattern.exec(value);
      } // end while
     
      HTMLAttributeNode[] nodeArray = new HTMLAttributeNode[nodeNames.size()];
      for (int y = 0; y < nodeNames.size(); y++) {
        String name = nodeNames.get(y);
View Full Code Here

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

     *             {@link #getCaptionPositionFromElement(Element)} instead
     */
    @Deprecated
    public CaptionPosition getCaptionPositionFromElement(
            com.google.gwt.user.client.Element captionWrap) {
        RegExp captionPositionRegexp = RegExp.compile("v-caption-on-(\\S+)");

        // Get caption position from the classname
        MatchResult matcher = captionPositionRegexp.exec(captionWrap
                .getClassName());
        if (matcher == null || matcher.getGroupCount() < 2) {
            return CaptionPosition.TOP;
        }
        String captionClass = matcher.getGroup(1);
View Full Code Here

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

     *            to vaadin element
     * @return true if path refers to UI element, false otherwise
     */
    public static boolean isUIElement(String path) {
        String regex = "^\\/{0,2}(com\\.vaadin\\.ui\\.)?V?UI[\\/\\[]?";
        RegExp regexp = RegExp.compile(regex);
        return regexp.test(path);
    }
View Full Code Here

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

     *            to vaadin element
     * @return true if path refers to Notification element, false otherwise
     */
    public static boolean isNotificationElement(String path) {
        String regex = "^\\/{0,2}(com\\.vaadin\\.ui\\.)?V?Notification[\\/\\[]?";
        RegExp regexp = RegExp.compile(regex);
        return regexp.test(path);
    }
View Full Code Here

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

     * @param args     Arguments to apply into format
     * @return Formatted string.
     * @see <a href="http://stackoverflow.com/questions/3126232/string-formatter-in-gwt">Stack Overflow</a>
     */
    public static String format(final String format, final Object... args) {
        RegExp regex = RegExp.compile("%[a-z]");
        SplitResult split = regex.split(format);
        StringBuffer msg = new StringBuffer();

        for (int pos = 0; pos < split.length() - 1; pos += 1) {
            msg.append(split.get(pos));
            msg.append(args[pos].toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.