Quantifiers
Quantifiers
It allows us to specify how many characters we do need to search, let’s dive right in
? Optional
It allows to find a text that contains or not a character
For the demonstration we are going to use a file named file.txt with this content:
Finding lines with JEE or J2EE
* Exact Coincidences
Finding lines with Java text (no matter where, beginning-middle-ending)
+ A Quantity Of Coincidences
Let’s replace the content by:
Finding two or more digits
{} Quantifiers for IDN
Let’s validate an identification number, we are looking for this pattern:
For this example we are use a file with this content:
The expression that we need is:
Let’s suppose that valid IDN is:
The expression that we need in this case is:
If you like this post please pay me with a click on the ads :)