To get familiar with regex, formatted output and the Console class, I wrote a small program. You can use it learn regex. You can change it / play around with it to solidify your knowledge. And of course you can look for bugs/errors or suggest improvements.
The program asks for a string to search in and a regex pattern. It prints matches with start and end index and it prints the original string with the matches highlighted in bold.
I don't know if printing in bold works in a windows console, it's tested on Linux with bash.
The program comes with no license, so you are totally free to use/change it
posted 7 years ago
I think that Windows console does not allow for bold fonts. On my machine (Windows Server 2008) the program output shows like:
text to parse: abc1ef6hi7k
search pattern: \d
hit 1: 1 (start: 3, end: 4)
hit 2: 6 (start: 6, end: 7)
hit 3: 7 (start: 9, end: 10)