RegExTextField Component
This Echo3 component is a subclass of the abstract class 'ActiveTextField' as described elsewhere.
This components can take two regular expression string, a filter string which is a list of valid input characters. This string is usually delimited with square braces. A second regular express string is used to valid the input and is usually bound by a caret character on the left and a dollar sign on the right which causes the entire input string to considered by the regex matcher.
Demonstration
|
Allows everything, match anything characterFilter: . |
||
|
Allows only upper case letters, three consecutive A's to be valid. characterFilter: [A-Z] |
||
|
Allow anything, three X's anywhere to be valid. characterFilter: . |
||
|
E-mail address. NB: does not validate domain or address characterFilter: [\\._a-z0-9@-] |
||
|
US Government Social Secuity Number characterFilter: [0-9-] |
||
|
Integer with 5 odd digits characterFilter: [13579] |
||
|
Integer with 5 even digits characterFilter: [02468] |
||
|
Nonsense filter: a-k, 0-3 or the minus sign; All input is valid. characterFilter: [a-k0-3-] |
RegExTextField - Summary API
package org.informagen.echo.app;
import org.informagen.echo.app.ActiveTextField;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class RegExTextField extends ActiveTextField {
public RegExTextField()
public RegExTextField(String filter, String regex)
public boolean isValid()
public void setFilter(final String filter)
public String getFilter()
public void setRegEx(final String regex)
public String getRegEx()
}