i have a set of regular expressions. The words in the regular expression should be used to replace the i/p with hyphens '---'. i need perl script to evaluate these regular expression. the words in the regexes when found in the i/p file should be replaced with hyphens '---'.
the set of regular expressions are:
1.\bTAKE\s?|THANK|DANC(ER|ED|ING|ME|S)\b
2.\b(HELL|HARD|J(AC|ER)K-OFF|JI(SM|Z(M)?))\b
3.\b(SKUL|SCHOOL)?GO(ER(S)?|IN(G)?)?\b
4.\b(TRICK(Y|S)?|TOLL(S)?|SPUNK|TWAT)\b
5.STAK(ES)?\s?HOLDER(S)?\s?
6.\PITCH(ES|IN|ING)?+\s?SALE(S)
7.\bBLOW\s?(JOB|JOBS)
The words in the regexes are in uppercase, but the script should take care of both upper and lower cases.
please help me with the exact script, because i'm very new to perl scripting.
Forgive me, but this smells like homework and is against the rules.
Also, just spell "input"... too many things stand for "i/p", such as "Internet Protocol". Leave a message for me if this is not the case, and I'll re-open the thread.
After your private message, I'm not convinced this is not homework. Nevertheless, I'll give you the benefit of the doubt and help you with one example.
In Perl, to turn the matching regular regular expression into a substituting one, you go from m/regexp/ to s/regexp/replacement/. So: