RegModel is easy way to looking regular text models.
RegModel allow you to :
- Matching text expressions.
- Parse any text. And extract what is needed or get the range.
- Fuzzy logic search and match.
- With RegModel it is not need any more to split the input string to many sub string and looking in them.
Why RegModel is better than regular expression :
- Easy to undersand.
- You can write a very complicated logic in few word.
- RegModel is very light and much faster technology compared to regular expressions.
- RegModel use small memory and have small footprint.
- RegModel is faser 200-300% then regular expression. Because RegModel not need to compile pattern.
A typical usage:
String bigString = "Women, from Montreal.";
RegModel regModel = new RegModel(bigString);
regModel.has("from"); //=> ok, selected model is 'from'
regModel.any(); //=> ok, selected model is rest to the end ' Montreal.'
regModel.toLeft$(); //=> change direction to search models from right to the left
regModel.letter(); //=> ok, selected model is 'from'
regModel.any(); //=> ok, selected model is rest to the begin 'Women, '
or
String bigString = "width: 100px;";
RegModel regModel = new RegModel(bigString);
regModel.fromStart$()
.letter(0,3) // => ok, selected model is 'wid'; accepted are between 0..3 letters
.letter(2) // => ok, selected model is 'th' accepted are between 1..2 letters
.char1(':') // => ok, selected model is ':' accepted one char ':'
.wspace(); // => ok, selected model is ' ' accepted characters are all white space such:' \n\t\r'
String width = regModel.digits().get(); // => ok, selected model is '100' accepted characters 0..9
String unit = regModel.letter().get(); // => ok, selected model is 'px'
You can see more information and video examples at https://jnode.eu/pageapp/RegModel/RegModel.html