Try this: #!/usr/bin/perl
for (<>) { s!\{_(Start|End)Range_\}!!; while (s!\{_Index\s+([^}]+)\s+_\}!!) { print "%s/$1//g\n" } } HTH, Alex. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]