Examples
Is the input given by the user a number?
(BTW which one is a number: 23, 2.3, 2.3.4, 2.4e3, abc ?)
Is there a word in the file that is repeated 3 or more times?
Replaces all occurrences of Perl or perl by Java ...
... but avoid replacing Perla.
Given a text message fetch all the phone numbers:
Fetch numbers that look like 09-1234567
then also fetch +972-2-1234567
and maybe also 09-123-4567
Check if in a given text passing your network there are credit card numbers....
Given a text find if the word "password" is in it and fetch the surrounding text.
Given a log file like this:
[Tue Jun 12 00:01:00 2006] - (3423) - INFO - ERROR log restarted
[Tue Jun 12 09:08:17 2006] - (3423) - INFO - System starts to work
[Tue Jun 13 08:07:16 2006] - (3423) - ERROR - Something is wrong
provide statistics on how many of the different levels of log messages
were seen. Separate the log messages into files.