java.util.regex.Matcher.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中java.util.regex.Matcher.<init>()方法的一些代码示例,展示了Matcher.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matcher.<init>()方法的具体详情如下:
包路径:java.util.regex.Matcher
类名称:Matcher
方法名:<init>

Matcher.<init>介绍

[英]No default constructor.
[中]没有默认构造函数。

代码示例

代码示例来源:origin: libgdx/libgdx

public Matcher matcher (CharSequence input) {
    return new Matcher(this, input);
  }
}

代码示例来源:origin: libgdx/libgdx

public Matcher matcher (CharSequence input) {
    return new Matcher(this, input);
  }
}

代码示例来源:origin: robovm/robovm

/**
 * Returns a {@link Matcher} for this pattern applied to the given {@code input}.
 * The {@code Matcher} can be used to match the {@code Pattern} against the
 * whole input, find occurrences of the {@code Pattern} in the input, or
 * replace parts of the input.
 */
public Matcher matcher(CharSequence input) {
  return new Matcher(this, input);
}

代码示例来源:origin: robovm/robovm

/**
 * Tests whether the given {@code regularExpression} matches the given {@code input}.
 * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}.
 * If the same regular expression is to be used for multiple operations, it may be more
 * efficient to reuse a compiled {@code Pattern}.
 *
 * @see Pattern#compile(java.lang.String, int)
 * @see Matcher#matches()
 */
public static boolean matches(String regularExpression, CharSequence input) {
  return new Matcher(new Pattern(regularExpression, 0), input).matches();
}

代码示例来源:origin: robovm/robovm

public static String[] split(Pattern pattern, String re, String input, int limit) {
  String[] fastResult = fastSplit(re, input, limit);
  if (fastResult != null) {
    return fastResult;
  }
  // Unlike Perl, which considers the result of splitting the empty string to be the empty
  // array, Java returns an array containing the empty string.
  if (input.isEmpty()) {
    return new String[] { "" };
  }
  // Collect text preceding each occurrence of the separator, while there's enough space.
  ArrayList<String> list = new ArrayList<String>();
  Matcher matcher = new Matcher(pattern, input);
  int begin = 0;
  while (list.size() + 1 != limit && matcher.find()) {
    list.add(input.substring(begin, matcher.start()));
    begin = matcher.end();
  }
  return finishSplit(list, input, begin, limit);
}

代码示例来源:origin: stackoverflow.com

Persister serializer = new Persister(new Matcher() {
 public Transform match(Class type) throws Exception {
   if (type.isEnum()) {
     return new MyEnumTransform(type);
   }
   return null;
 }
});

代码示例来源:origin: stackoverflow.com

result = search( aList, new Matcher(){ public boolean matches( Some some ) { 
 if( some.name().equals("a")) { 
   return true;
 }
}});

代码示例来源:origin: MobiVM/robovm

/**
 * Returns a {@link Matcher} for this pattern applied to the given {@code input}.
 * The {@code Matcher} can be used to match the {@code Pattern} against the
 * whole input, find occurrences of the {@code Pattern} in the input, or
 * replace parts of the input.
 */
public Matcher matcher(CharSequence input) {
  return new Matcher(this, input);
}

代码示例来源:origin: stackoverflow.com

public Matcher matcher(CharSequence input) {
  if (!compiled) {
    synchronized(this) {
      if (!compiled)
        compile();
    }
  }
  Matcher m = new Matcher(this, input);
  return m;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns a {@link Matcher} for this pattern applied to the given {@code input}.
 * The {@code Matcher} can be used to match the {@code Pattern} against the
 * whole input, find occurrences of the {@code Pattern} in the input, or
 * replace parts of the input.
 */
public Matcher matcher(CharSequence input) {
  return new Matcher(this, input);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns a {@link Matcher} for this pattern applied to the given {@code input}.
 * The {@code Matcher} can be used to match the {@code Pattern} against the
 * whole input, find occurrences of the {@code Pattern} in the input, or
 * replace parts of the input.
 */
public Matcher matcher(CharSequence input) {
  return new Matcher(this, input);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns a {@link Matcher} for this pattern applied to the given {@code input}.
 * The {@code Matcher} can be used to match the {@code Pattern} against the
 * whole input, find occurrences of the {@code Pattern} in the input, or
 * replace parts of the input.
 */
public Matcher matcher(CharSequence input) {
  return new Matcher(this, input);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns a {@link Matcher} for this pattern applied to the given {@code input}.
 * The {@code Matcher} can be used to match the {@code Pattern} against the
 * whole input, find occurrences of the {@code Pattern} in the input, or
 * replace parts of the input.
 */
public Matcher matcher(CharSequence input) {
  return new Matcher(this, input);
}

代码示例来源:origin: stackoverflow.com

String name = "Mike"; // This is an English name
String nameRegEx ="[A-Z][a-z]+"; //this patterns matches an english name
Matcher nameMatcher = new Matcher(regEx);
if (match.matches(name)){// I use the matches() method to verify the format of the string
  Name nameObject = Converter.getNameObjectFromString(name);//I make the conversion
}

代码示例来源:origin: dragome/dragome-sdk

/**
 * Creates a matcher that will match the given input against this pattern.
 */
public Matcher matcher(CharSequence input)
{
  pattern= pattern.replace("*+", "+");
  return new Matcher(this, input);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Tests whether the given {@code regularExpression} matches the given {@code input}.
 * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}.
 * If the same regular expression is to be used for multiple operations, it may be more
 * efficient to reuse a compiled {@code Pattern}.
 *
 * @see Pattern#compile(java.lang.String, int)
 * @see Matcher#matches()
 */
public static boolean matches(String regularExpression, CharSequence input) {
  return new Matcher(new Pattern(regularExpression, 0), input).matches();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Tests whether the given {@code regularExpression} matches the given {@code input}.
 * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}.
 * If the same regular expression is to be used for multiple operations, it may be more
 * efficient to reuse a compiled {@code Pattern}.
 *
 * @see Pattern#compile(java.lang.String, int)
 * @see Matcher#matches()
 */
public static boolean matches(String regularExpression, CharSequence input) {
  return new Matcher(new Pattern(regularExpression, 0), input).matches();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Tests whether the given {@code regularExpression} matches the given {@code input}.
 * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}.
 * If the same regular expression is to be used for multiple operations, it may be more
 * efficient to reuse a compiled {@code Pattern}.
 *
 * @see Pattern#compile(java.lang.String, int)
 * @see Matcher#matches()
 */
public static boolean matches(String regularExpression, CharSequence input) {
  return new Matcher(new Pattern(regularExpression, 0), input).matches();
}

代码示例来源:origin: ibinti/bugvm

/**
 * Tests whether the given {@code regularExpression} matches the given {@code input}.
 * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}.
 * If the same regular expression is to be used for multiple operations, it may be more
 * efficient to reuse a compiled {@code Pattern}.
 *
 * @see Pattern#compile(java.lang.String, int)
 * @see Matcher#matches()
 */
public static boolean matches(String regularExpression, CharSequence input) {
  return new Matcher(new Pattern(regularExpression, 0), input).matches();
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Tests whether the given {@code regularExpression} matches the given {@code input}.
 * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}.
 * If the same regular expression is to be used for multiple operations, it may be more
 * efficient to reuse a compiled {@code Pattern}.
 *
 * @see Pattern#compile(java.lang.String, int)
 * @see Matcher#matches()
 */
public static boolean matches(String regularExpression, CharSequence input) {
  return new Matcher(new Pattern(regularExpression, 0), input).matches();
}

相关文章