March 13th, 2013, 05:47 PM
Join Date: Mar 2013
Time spent in forums: 21 m 53 sec
Reputation Power: 0
Other - Regular Expression (linux)
It is the first time I have to do something with Regular Expression Programing and I have a task to do the following things:
Write a regular expression for pattern matching of Libian president Moamer Gadhaphy that includes the following variants of his name:
- Muammar al-Kaddafi (BBC)
- Moammar Gadhafi (Assiciated Press)
- Muammar al-Qadhafi (Al-Jazeera)
- Mu'ammar Al-Qadhafi (U.S. Department of State)
- Moamer Gadafi (STA)
At the beginning I thought it would be the best to concetrate only on the first name Moamer. I see that I have substitution and insertions.
To make things easier I made a table:
M U A M M A R
M O A M M A R
M U ' A M M A R
M O A M E R
M [U|O A|' M|A M|E A|M|R R] - I know this is not correct but that's how I understand substitutions and insertions.
I would be very grateful, if you could paste me some links with some examples of this. I am sitting in front of computer for some while now, but internet is too full of information which aren't useful for me. What should I use?
Thank you very much for your help!
Have a nice day,