Tabnine Logo
PApplet.match
Code IndexAdd Tabnine to your IDE (free)

How to use
match
method
in
processing.core.PApplet

Best Java code snippets using processing.core.PApplet.match (Showing top 12 results out of 315)

origin: ajavamind/Processing-Cardboard

static protected int getShaderType(String[] source, int defaultType) {
 for (int i = 0; i < source.length; i++) {
  String line = source[i].trim();
  if (PApplet.match(line, pointShaderAttrRegexp) != null)
   return PShader.POINT;
  else if (PApplet.match(line, lineShaderAttrRegexp) != null)
   return PShader.LINE;
  else if (PApplet.match(line, pointShaderDefRegexp) != null)
   return PShader.POINT;
  else if (PApplet.match(line, lineShaderDefRegexp) != null)
   return PShader.LINE;
  else if (PApplet.match(line, colorShaderDefRegexp) != null)
   return PShader.COLOR;
  else if (PApplet.match(line, lightShaderDefRegexp) != null)
   return PShader.LIGHT;
  else if (PApplet.match(line, texShaderDefRegexp) != null)
   return PShader.TEXTURE;
  else if (PApplet.match(line, texlightShaderDefRegexp) != null)
   return PShader.TEXLIGHT;
  else if (PApplet.match(line, polyShaderDefRegexp) != null)
   return PShader.POLY;
  else if (PApplet.match(line, triShaderAttrRegexp) != null)
   return PShader.POLY;
  else if (PApplet.match(line, quadShaderAttrRegexp) != null)
   return PShader.POLY;
 }
 return defaultType;
}
origin: org.processing/core

String line = source[i].trim();
if (PApplet.match(line, colorShaderDefRegexp) != null)
 return PShader.COLOR;
else if (PApplet.match(line, lightShaderDefRegexp) != null)
 return PShader.LIGHT;
else if (PApplet.match(line, texShaderDefRegexp) != null)
 return PShader.TEXTURE;
else if (PApplet.match(line, texlightShaderDefRegexp) != null)
 return PShader.TEXLIGHT;
else if (PApplet.match(line, polyShaderDefRegexp) != null)
 return PShader.POLY;
else if (PApplet.match(line, triShaderAttrRegexp) != null)
 return PShader.POLY;
else if (PApplet.match(line, quadShaderAttrRegexp) != null)
 return PShader.POLY;
else if (PApplet.match(line, pointShaderDefRegexp) != null)
 return PShader.POINT;
else if (PApplet.match(line, lineShaderDefRegexp) != null)
 return PShader.LINE;
else if (PApplet.match(line, pointShaderAttrRegexp) != null)
 return PShader.POINT;
else if (PApplet.match(line, pointShaderInRegexp) != null)
 return PShader.POINT;
else if (PApplet.match(line, lineShaderAttrRegexp) != null)
 return PShader.LINE;
else if (PApplet.match(line, lineShaderInRegexp) != null)
 return PShader.LINE;
origin: ajavamind/Processing-Cardboard

/**
 * Return the row that contains the first String that matches.
 * @param regexp the String to match
 * @param column ID number of the column to search
 */
public int matchRowIndex(String regexp, int column) {
 checkColumn(column);
 if (columnTypes[column] == STRING) {
  String[] stringData = (String[]) columns[column];
  for (int row = 0; row < rowCount; row++) {
   if (stringData[row] != null &&
     PApplet.match(stringData[row], regexp) != null) {
    return row;
   }
  }
 } else {  // less efficient, includes conversion as necessary
  for (int row = 0; row < rowCount; row++) {
   String str = getString(row, column);
   if (str != null &&
     PApplet.match(str, regexp) != null) {
    return row;
   }
  }
 }
 return -1;
}
origin: org.processing/core

/**
 * Return the row that contains the first String that matches.
 * @param regexp the String to match
 * @param column ID number of the column to search
 */
public int matchRowIndex(String regexp, int column) {
 checkColumn(column);
 if (columnTypes[column] == STRING) {
  String[] stringData = (String[]) columns[column];
  for (int row = 0; row < rowCount; row++) {
   if (stringData[row] != null &&
     PApplet.match(stringData[row], regexp) != null) {
    return row;
   }
  }
 } else {  // less efficient, includes conversion as necessary
  for (int row = 0; row < rowCount; row++) {
   String str = getString(row, column);
   if (str != null &&
     PApplet.match(str, regexp) != null) {
    return row;
   }
  }
 }
 return -1;
}
origin: org.processing/core

/**
 * Return a list of rows that contain the String passed in. If there are no
 * matches, a zero length array will be returned (not a null array).
 * @param regexp the String to match
 * @param column ID number of the column to search
 */
public int[] matchRowIndices(String regexp, int column) {
 int[] outgoing = new int[rowCount];
 int count = 0;
 checkColumn(column);
 if (columnTypes[column] == STRING) {
  String[] stringData = (String[]) columns[column];
  for (int row = 0; row < rowCount; row++) {
   if (stringData[row] != null &&
     PApplet.match(stringData[row], regexp) != null) {
    outgoing[count++] = row;
   }
  }
 } else {  // less efficient, includes conversion as necessary
  for (int row = 0; row < rowCount; row++) {
   String str = getString(row, column);
   if (str != null &&
     PApplet.match(str, regexp) != null) {
    outgoing[count++] = row;
   }
  }
 }
 return PApplet.subset(outgoing, 0, count);
}
origin: Calsign/APDE

  static public String[] parseSketchSmooth(String code, boolean fussy, Context context) {
    String[] matches = PApplet.match(scrubComments(code), SMOOTH_REGEX);
    
    if (matches != null) {
      boolean badSmooth = false;
      
      if (PApplet.parseInt(matches[1], -1) == -1) {
        badSmooth = true;
      }
      
      if (badSmooth && fussy) {
        // found a reference to smooth, but it didn't seem to contain numbers
//                final String message =
//                        "The smooth level of this applet could not automatically\n" +
//                                "be determined from your code. Use only a numeric\n" +
//                                "value (not variables) for the smooth() command.\n" +
//                                "See the smooth() reference for an explanation.";
//                Messages.showWarning("Could not find smooth level", message, null);
        showWarning(context.getResources().getString(R.string.preproc_no_smooth), context.getResources().getString(R.string.preproc_no_smooth_message));
//        new Exception().printStackTrace(System.out);
        return null;
      }
      
      return matches;
    }
    return new String[] { null, null };  // not an error, just empty
  }
  
origin: ajavamind/Processing-Cardboard

/**
 * Return a list of rows that contain the String passed in. If there are no
 * matches, a zero length array will be returned (not a null array).
 * @param what the String to match
 * @param column ID number of the column to search
 */
public int[] matchRowIndices(String regexp, int column) {
 int[] outgoing = new int[rowCount];
 int count = 0;
 checkColumn(column);
 if (columnTypes[column] == STRING) {
  String[] stringData = (String[]) columns[column];
  for (int row = 0; row < rowCount; row++) {
   if (stringData[row] != null &&
     PApplet.match(stringData[row], regexp) != null) {
    outgoing[count++] = row;
   }
  }
 } else {  // less efficient, includes conversion as necessary
  for (int row = 0; row < rowCount; row++) {
   String str = getString(row, column);
   if (str != null &&
     PApplet.match(str, regexp) != null) {
    outgoing[count++] = row;
   }
  }
 }
 return PApplet.subset(outgoing, 0, count);
}
origin: org.processing/core

static protected PMatrix2D parseSingleTransform(String matrixStr) {
 String[] pieces = PApplet.match(matrixStr, "[,\\s]*(\\w+)\\((.*)\\)");
 if (pieces == null) {
  System.err.println("Could not parse transform " + matrixStr);
origin: ajavamind/Processing-Cardboard

static protected PMatrix2D parseSingleTransform(String matrixStr) {
 String[] pieces = PApplet.match(matrixStr, "[,\\s]*(\\w+)\\((.*)\\)");
 if (pieces == null) {
  System.err.println("Could not parse transform " + matrixStr);
origin: Calsign/APDE

  String[] m = PApplet.match(msg, "found ('.*')");
String[] matches = PApplet.match(tsre.toString(), mess);
if (matches != null) {
  int errorLine = Integer.parseInt(matches[1]) - 1;
  try {
    String javaCode = meta.getText();
    String[] packageMatch = PApplet.match(javaCode, PACKAGE_REGEX);
origin: ajavamind/Processing-Cardboard

String[] m = PApplet.match(name, "_x([A-Za-z0-9]{2})_");
if (m == null) break;
char repair = (char) PApplet.unhex(m[1]);
origin: org.processing/core

String[] m = PApplet.match(name, "_x([A-Za-z0-9]{2})_");
if (m == null) break;
char repair = (char) PApplet.unhex(m[1]);
processing.corePAppletmatch

Javadoc

( begin auto-generated from match.xml ) The match() function is used to apply a regular expression to a piece of text, and return matching groups (elements found inside parentheses) as a String array. No match will return null. If no groups are specified in the regexp, but the sequence matches, an array of length one (with the matched text as the first element of the array) will be returned.

To use the function, first check to see if the result is null. If the result is null, then the sequence did not match. If the sequence did match, an array is returned. If there are groups (specified by sets of parentheses) in the regexp, then the contents of each will be returned in the array. Element [0] of a regexp match returns the entire matching string, and the match groups start at element [1] (the first group is [1], the second [2], and so on).

The syntax can be found in the reference for Java's Pattern class. For regular expression syntax, read the Java Tutorial on the topic. ( end auto-generated )

Popular methods of PApplet

  • constrain
  • createGraphics
    Create an offscreen graphics surface for drawing, in this case for a renderer that writes to a file
  • loadStrings
    ( begin auto-generated from loadStrings.xml ) Reads the contents of a file or url and creates a Stri
  • saveStrings
    ( begin auto-generated from saveStrings.xml ) Writes an array of strings to a file, one line per str
  • abs
  • createImage
    ( begin auto-generated from createImage.xml ) Creates a new PImage (the datatype for storing images)
  • createShape
  • createWriter
    ( begin auto-generated from createWriter.xml ) Creates a new file in the sketch folder, and a PrintW
  • loadImage
  • main
    main() method for running this class from the command line. Usage: PApplet [options] [s
  • max
  • parseInt
  • max,
  • parseInt,
  • random,
  • round,
  • split,
  • sqrt,
  • unhex,
  • arrayCopy,
  • ceil,
  • checkExtension

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • BoxLayout (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now