public class Regex9
extends java.lang.Object
Helper functions for PreludeBase and PreludeRegex
The methods here help us to hide the Matcher
type,
which is impure, and cannot made pure, because copying is effectively impossible
at least from JDK9 on.
Instead, all Frege code will work with MatchResult
, which is
a pure interface, and since JDK9 apparently backed by an immutable class.
Constructor and Description |
---|
Regex9() |
Modifier and Type | Method and Description |
---|---|
static boolean |
find(java.lang.String s,
java.util.regex.Pattern p)
implements the (~) operator
|
static java.util.regex.MatchResult |
findResult(java.lang.String s,
java.util.regex.Pattern p)
implements the (=~) operator
|
static java.util.regex.MatchResult |
findResult(java.lang.String s,
java.util.regex.Pattern p,
int n)
implements the findAt function with offset
|
static java.lang.String |
replaceAll(java.lang.String s,
java.util.regex.Pattern p,
java.lang.String r)
implements replaceAll
|
static java.lang.String |
replaceFirst(java.lang.String s,
java.util.regex.Pattern p,
java.lang.String r)
implements replaceFirst
|
public static java.util.regex.MatchResult findResult(java.lang.String s, java.util.regex.Pattern p)
implements the (=~) operator
public static java.util.regex.MatchResult findResult(java.lang.String s, java.util.regex.Pattern p, int n)
implements the findAt function with offset
public static boolean find(java.lang.String s, java.util.regex.Pattern p)
implements the (~) operator
public static java.lang.String replaceFirst(java.lang.String s, java.util.regex.Pattern p, java.lang.String r)
implements replaceFirst
public static java.lang.String replaceAll(java.lang.String s, java.util.regex.Pattern p, java.lang.String r)
implements replaceAll