Package eu.bandm.tools.paisley
Class StringPatterns
java.lang.Object
eu.bandm.tools.paisley.StringPatterns
@Generated(generator="eu.bandm.tools.expander",
version="",
timestamp="2026-01-12T17:56:35")
public abstract class StringPatterns
extends Object
Static factory methods for creating patterns for strings and regular
expressions.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class -
Method Summary
Modifier and TypeMethodDescriptionReturns a pattern that matches strings ending with a given suffix.equalsIgnoreCase(String str) Returns a pattern that matches strings that equal a given string ignoring case.Returns a pattern that matches strings whose length is matched by a given pattern.Returns a pattern that matches strings that match a given regex string.Returns a pattern that matches strings that match a given regex string, with given patterns matching the substrings captured by groups.startsWith(String prefix) Returns a pattern that matches strings starting with a given prefix.Returns a pattern that matches a string by matching a given subpattern disjunctively against its tokenized substrings.Returns a pattern that matches a string by matching a given subpattern disjunctively against its tokenized substrings.Returns a pattern that matches a string by matching a given subpattern disjunctively against its tokenized substrings.
-
Method Details
-
startsWith
Returns a pattern that matches strings starting with a given prefix.A pattern returned by this method is deterministic and binds no variables.
- Parameters:
prefix- the prefix to match against- Returns:
- a pattern that matches the string
targetif and only if it starts withprefix - Throws:
NullPointerException- ifprefixis null.- See Also:
-
endsWith
Returns a pattern that matches strings ending with a given suffix.A pattern returned by this method is deterministic and binds no variables.
- Parameters:
suffix- the suffix to match against- Returns:
- a pattern that matches the string
targetif and only if it ends withsuffix - Throws:
NullPointerException- ifsuffixis null.- See Also:
-
equalsIgnoreCase
Returns a pattern that matches strings that equal a given string ignoring case.A pattern returned by this method is deterministic and binds no variables.
- Parameters:
str- the str to match against- Returns:
- a pattern that matches the string
targetif and only if it equalsstrignoring case - Throws:
NullPointerException- ifstris null.- See Also:
-
matches
Returns a pattern that matches strings that match a given regex string.A pattern returned by this method is deterministic and binds no variables.
- Parameters:
regex- the regex string to match against- Returns:
- a pattern that matches the string
targetif and only if it matchesregex - Throws:
NullPointerException- ifregexis null.- See Also:
-
length
Returns a pattern that matches strings whose length is matched by a given pattern.A pattern returned by this method is deterministic and binds no variables.
- Parameters:
length- the pattern to match string length against- Returns:
- a pattern that matches the string
targetif and only if its length is matched bylength - Throws:
NullPointerException- iflengthis null.- See Also:
-
matches
Returns a pattern that matches strings that match a given regex string, with given patterns matching the substrings captured by groups.Note that explicit groups are numbered from one; the implicit group with number zero is the whole pattern.
- Parameters:
regex- the regex string to match againstps- an array of patterns to match against the substrings captured by groups.- Returns:
- a pattern that matches the string
targetif and only if it matchesregex - Throws:
NullPointerException- ifregexis null, or ifpsis or contains null.IllegalArgumentException- if the number of group patterns does not match the number of capturing groups- See Also:
-
find
-
tokenize
Returns a pattern that matches a string by matching a given subpattern disjunctively against its tokenized substrings.This method uses the Java whitespace characters
" \t\n\r\f"as delimiters.- Parameters:
body- the pattern to match agains tokenized substrings- Returns:
- a pattern that matches a string by matching
bodydisjunctively against its tokenized substrings - Throws:
NullPointerException- ifbodyis null- See Also:
-
tokenize
Returns a pattern that matches a string by matching a given subpattern disjunctively against its tokenized substrings.- Parameters:
delim- the delimitersbody- the pattern to match agains tokenized substrings- Returns:
- a pattern that matches a string by matching
bodydisjunctively against its tokenized substrings - Throws:
NullPointerException- ifbodyis null- See Also:
-
tokenize
public static Pattern<String> tokenize(String delim, boolean returnDelims, Pattern<? super String> body) Returns a pattern that matches a string by matching a given subpattern disjunctively against its tokenized substrings.- Parameters:
delim- the delimitersreturnDelims- flag indicating whether to return the delimiters as tokensbody- the pattern to match agains tokenized substrings- Returns:
- a pattern that matches a string by matching
bodydisjunctively against its tokenized substrings - Throws:
NullPointerException- ifbodyis null- See Also:
-