Codota Logo
Pattern.toString
Code IndexAdd Codota to your IDE (free)

How to use
toString
method
in
java.util.regex.Pattern

Best Java code snippets using java.util.regex.Pattern.toString (Showing top 20 results out of 3,555)

  • Common ways to obtain Pattern
private void myMethod () {
Pattern p =
  • Codota IconString regex;Pattern.compile(regex)
  • Codota IconString regex;Pattern.compile(regex, flags)
  • Codota IconStringBuffer regex;Pattern.compile(regex.toString())
  • Smart code suggestions by Codota
}
origin: google/guava

@Override
public String toString() {
 return pattern.toString();
}
origin: prestodb/presto

@Override
public String toString() {
 return pattern.toString();
}
origin: google/j2objc

@Override
public String toString() {
 return pattern.toString();
}
origin: SonarSource/sonarqube

 boolean hasSecondPattern() {
  return StringUtils.isNotEmpty(secondPattern.toString());
 }
}
origin: Atmosphere/atmosphere

/**
 * Construct a new URI pattern.
 *
 * @param regexPattern the regular expression pattern
 * @param groupIndexes the array of group indexes to capturing groups.
 * @throws IllegalArgumentException if the regexPattern is null.
 */
public UriPattern(Pattern regexPattern, int[] groupIndexes) {
  if (regexPattern == null)
    throw new IllegalArgumentException();
  this.regex = regexPattern.toString();
  this.regexPattern = regexPattern;
  this.groupIndexes = groupIndexes;
}
origin: stanfordnlp/CoreNLP

public Entry(List<Pattern> regex, String type, Set<String> overwritableTypes, double priority) {
 this.regex = regex;
 this.type = type.intern();
 this.overwritableTypes = overwritableTypes;
 this.priority = priority;
 // Efficiency shortcut
 for (Pattern p : regex) {
  if (p.toString().matches("[a-zA-Z0-9]+")) {
   exact.add(p.toString());
  } else {
   exact.add(null);
  }
 }
}
origin: prestodb/presto

private static void addNamedGroups(Pattern pattern, HashSet<String> variables)
{
  Matcher matcher = NAMED_GROUPS_PATTERN.matcher(pattern.toString());
  while (matcher.find()) {
    String name = matcher.group(1);
    checkArgument(!variables.contains(name), "Multiple definitions found for variable ${" + name + "}");
    variables.add(name);
  }
}
origin: apache/pulsar

public static List<String> topicsPatternFilter(List<String> original, Pattern topicsPattern) {
  final Pattern shortenedTopicsPattern = topicsPattern.toString().contains("://")
    ? Pattern.compile(topicsPattern.toString().split("\\:\\/\\/")[1]) : topicsPattern;
  return original.stream()
    .map(TopicName::get)
    .map(TopicName::toString)
    .filter(topic -> shortenedTopicsPattern.matcher(topic.split("\\:\\/\\/")[1]).matches())
    .collect(Collectors.toList());
}
origin: apache/hbase

@Override
public HTableDescriptor[] listTables(Pattern pattern) throws IOException {
 String regex = (pattern == null ? null : pattern.toString());
 return listTables(regex);
}
origin: apache/hbase

@Override
public HTableDescriptor[] listTables(Pattern pattern, boolean includeSysTables)
  throws IOException {
 String regex = (pattern == null ? null : pattern.toString());
 return listTables(regex, includeSysTables);
}
origin: apache/hbase

@Override
public TableName[] listTableNames(Pattern pattern, boolean includeSysTables) throws IOException {
 String regex = (pattern == null ? null : pattern.toString());
 return listTableNames(regex, includeSysTables);
}
origin: nutzam/nutz

@Override
public Object check(Object val) throws NutValidateException {
  if(null==val)
    return null;
  String s = val.toString();
  if (!p.matcher(s).find()) {
    throw new NutValidateException("InvalidString", p.toString(), s);
  }
  return val;
}
origin: stanfordnlp/CoreNLP

@Override
public String toString() {
 String result;
 switch(mode) {
 case FIXED:
  return label + '(' + children[0].toString() + ',' + newLabel + ')';
 case REGEX:
  return label + '(' + children[0].toString() + ',' + labelRegex.toString() + ',' + replacementString + ')';
 default:
  throw new AssertionError("Unsupported relabel mode " + mode);
 }
}
origin: apache/hbase

@Override
public List<TableDescriptor> listTableDescriptors(Pattern pattern, boolean includeSysTables)
  throws IOException {
 try {
  String regex = (pattern == null ? null : pattern.toString());
  List<TTableDescriptor> tTableDescriptors = client
    .getTableDescriptorsByPattern(regex, includeSysTables);
  return ThriftUtilities.tableDescriptorsFromThrift(tTableDescriptors);
 } catch (TException e) {
  throw new IOException(e);
 }
}
origin: neo4j/neo4j

  @Override
  public void describeTo( Description description )
  {
    description.appendText( "a string matching /" );
    description.appendText( pattern.toString() );
    description.appendText( "/" );
  }
}
origin: neo4j/neo4j

  @Override
  public void describeTo( Description description )
  {
    description.appendValue( SUCCESS )
        .appendText( format( " with metadata %s ~ %s", key, pattern.toString() ) );
  }
};
origin: immutables/immutables

@Override
public void write(JsonWriter out, Pattern value) throws IOException {
 if (value == null) {
  out.nullValue();
 } else if (out instanceof BsonWriter) {
  ((BsonWriter) out).unwrap()
      .writeRegularExpression(new BsonRegularExpression(value.pattern()));
 } else {
  out.value(value.toString());
 }
}
origin: apache/hbase

public static ListReplicationPeersRequest buildListReplicationPeersRequest(Pattern pattern) {
 ListReplicationPeersRequest.Builder builder = ListReplicationPeersRequest.newBuilder();
 if (pattern != null) {
  builder.setRegex(pattern.toString());
 }
 return builder.build();
}
origin: apache/hive

public static void validatePartitionNameCharacters(List<String> partVals,
                          Pattern partitionValidationPattern) throws MetaException {
 String invalidPartitionVal = getPartitionValWithInvalidCharacter(partVals, partitionValidationPattern);
 if (invalidPartitionVal != null) {
  throw new MetaException("Partition value '" + invalidPartitionVal +
    "' contains a character " + "not matched by whitelist pattern '" +
    partitionValidationPattern.toString() + "'.  " + "(configure with " +
    MetastoreConf.ConfVars.PARTITION_NAME_WHITELIST_PATTERN.getVarname() + ")");
 }
}
origin: pmd/pmd

@Override
public Object visit(ASTEnumConstant node, Object data) {
  // This inlines checkMatches because there's no variable declarator id
  if (!getProperty(enumConstantRegex).matcher(node.getImage()).matches()) {
    addViolation(data, node, new Object[]{
      "enum constant",
      node.getImage(),
      getProperty(enumConstantRegex).toString(),
    });
  }
  return data;
}
java.util.regexPatterntoString

Javadoc

Returns the string representation of this pattern. This is the regular expression from which this pattern was compiled.

Popular methods of Pattern

  • matcher
    Creates a matcher that will match the given input against this pattern.
  • compile
  • quote
    Returns a literal pattern String for the specifiedString.This method produces a String that can be u
  • split
    Splits the given input sequence around matches of this pattern. The array returned by this method co
  • pattern
  • matches
  • flags
    Returns this pattern's match flags.
  • splitAsStream
  • asPredicate
  • <init>
    This private constructor is used to create all Patterns. The pattern string and match flags are all
  • closeImpl
  • compileImpl
  • closeImpl,
  • compileImpl,
  • closure,
  • error,
  • escape,
  • RemoveQEQuoting,
  • accept,
  • addFlag,
  • append

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • notifyDataSetChanged (ArrayAdapter)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Notification (javax.management)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now