what regular expressions?
this site has the whole manual.
for text files, you will have to first open or read the file, depending on what you want to do.
look for "fopen" or "file" functions.
if you use "file" the text file will be in an array as lines.
so if you did:
$open = file("my_file.txt");
echo $open[0];
will print out the first line of the text file.
you could also do:
$open = fopen("my_file.txt", "w");
$find = ereg_replace("hello how are you", "", $open);
fclose($open);
this may be a little off, but it will find all the "hello how are you"'s in the file and erase them.
Do some searches. They are fairly simple (with the exception on syntax that messes them up occasionally) once you read up on them some.
type in www.phpbuilder.com and then in the search box type in ereg_replace to get you started