^[a-z]*p[a-z\s]{1}t[a-z]*$
^ indicates the beginning of a string or line, and $ indicates the end
/s is space
[a-z] means any of the lower case letters a-z
[a-z]* means any of the lower case letters a-z repeated 0 or more times
This is followed by the letter p
[a-z\s]{1} means any of the lowercase letters a-z or space exactly one time
This is followed by the letter t. (Exactly one lowercase letter or space is between the p and t in the column on the left
[a-z]* means any of the lower case letters a-z repeated 0 or more times after the t
and $ means you reached the end of the string.
This book has a free trial:
https://www.oreilly.com/
https://www.oreilly.com/
This is the web site for the third edition of Mastering Regular Expressions, by Jeffrey Friedl. http://regex.info/book.html errors in each edition and downloadable code, including egrep
When your language definition accepts an empty string then your language is Nullable. If your language is Nullable, then your language accepts the empty string.
iff = with three lines is a definition if and only if
A rectangle is a square when there are equal length sides and 90' anglesA square is a rectangle with equal length sides and 90' angles
Here is a practice sheet:
This has a phone number example at the end:
Here is a coding example that defines 2 fields as Nullable and 2 without being Nullable.
No comments:
Post a Comment