Meta-Characters
Meta-Characters
RegEx uses heavily meta-characters in order to easily find patterns inside a file
[] Brackets
It allows to define a range of characters for find them in a file.
For the demonstration we are going to use a file named file.txt with this content:
Finding alphabetic characters
Finding numbers
^ Negate
Finding no-alphabetic characters
Finding no numbers
Searching Text Starting and Ending With
For the sake of simplicity let’s change the content of the file by:
^[ Starting With
Finding text starting with a number
$ Ending With
Finding text ending in a number
If you like this post please pay me with a click on the ads :)