# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"^\s?[\u1040-\u1049]{1,2}။\s?(?:[\u1000-\u104F\s\-\(\)]+)(?:[\w\s\(\)&\.]+)-(.*?)\n"
test_str = ("ကိုယ်တိုင်ရေးပုံတူ\n"
"၁။ ကိုယ်တိုင်ရေးပုံတူ Art Company - Suzanna\n"
"၂။ ဘာအကောင်းဆုံးလည်း Australian Crawl - The Boys Light Up\n"
"၃။ အချစ်ကြေညာစာတမ်း The Art Company - Maybe Tomorrow\n"
"၄။ ကော်ဖီခါးခါး John Cougar - Authority Song\n"
"၅။ တချို့ကကံကောင်းတယ် The Persuaders - Some Guys Have All the Luck\n"
"၆။ မမရောဂါ The Art Company - Eileen\n"
"၇။ ကြေးစား The Hooters- All You Zombies (credit to @Tun Tun songbook)\n"
"၈။ အပြင်လူ-Danger List - John.C.Mellencamp\n"
"၉။ မာယာ Saphir - I Feel Good\n"
"၁၀။ အက်ဆစ်ဝိုင်ချို John.C Mellencamp - Rain on the Scarecrow\n"
"၁၁။ စက်ရုပ်မဟုတ်ဘူး Greg Kihn Band - The Break Up Song\n"
"၁၂။ အချစ်ဒိဋ္ဌိ Smokie - Stranger\n"
"၁၃။ စိန်ခေါ်ပွဲ Geff Harrison - Bad New York City\n"
"၁၄။ သင်္ဘောမှောက်ခြင်း Joe Cocker - Don't You Love Me Anymore\n\n"
"“ ကော်ဖီခါးခါး “\n"
"၁။ ကော်ဖီခါးခါး John Cougar - Authority song\n"
"၂။ တချို့ကကံကောင်းတယ် The Shaker - Some guys have all the luck (The Persuaders)\n"
"၃။ ထမိန်တိုတို ရှန်ပိန် Julian Lennon - Too late for goodbyes\n"
"၄။ ကိုယ်တိုင်ရေးပုံတူ The Art Company - Susanna\n"
"၅။ လေဟာနယ်ထဲမှာ Sutherland Brothers and Quiver - Dr Dancer\n"
"၆။ အိမ်မက်ဝိုင် Sutherland Brothers and Quiver - Arms of Mary\n"
"၇။ မင်းသဘော Bread - Let your love go\n"
"၈။ အချစ်ဝိုင် Bonnie Tyler - Here she comes\n"
"၉။ စက်ရုပ်မဟုတ်ဘူး Greg Khin Band - The break up song\n"
"၁၀။ တင်းနစ်သမား Chris Rea - Tennis\n"
"၁၁။ အပြင်လူ John Cougar - Danger list\n"
"၁၂။ မာရ်နတ်ရဲ့ သမီး Albert Hammond - Peacemaker\n"
"၁၃။ သစ္စာ (အကျိုးပြု) Billy Joel - Honesty\n"
"၁၄။ မျက်ရည်ကျရင် အရှုံး America - And forever\n"
"၁၅။ ရွှေရောင်အာရုဏ် Steve Miller Band - Swing town\n\n"
"“မျှော်လင့်ချက်”\n"
"၁။ ချိုသဲ Craig Mclachaln & Check - Mona\n"
"၂။ အမောပြေ လရောင် ??????\n"
"၃။ လှသောပြသနာ ??????\n"
"၄။ လွဲချော်ခြင်း The Beatles - Don't let me down\n"
"၅။ မျှော်လင့်ချက် ??????\n"
"၆။ ရက်ရက်စက်စက် Bonnie Tyler - Take me back\n"
"၇။ ကလေးတစ်ယောက်အိမ်မက် Freddie Augllia - Anak\n"
"၈။ သာရွေ့ဝေးသော Bon Jovi - Runaway\n"
"၉။ အသည်းအသန်ည Bonnie Tyler - My guns are loaded\n"
"၁၀။ မျက်နှာဖုံး Men at Work - Down under\n"
"၁၁။ တစ်ဖက်သတ်အချစ် ???????\n"
"၁၂။ ပထမ အသည်းကွဲဇာတ်လမ်း Smokie - Living next door to alice\n"
"၁၃။ ရင်အခုန်အခ ျစ် Tanya Tucker - A thing called love\n"
"၁၄။ သံသရာ Scorpions - Is there anybody there\n"
"၁၅။ အားလုံး Culture Club - Everything I own (original Bread)\n\n"
"“ယန္တာရား”\n"
"၁။ ယန္တရား John Cougar - Human wheel\n"
"၂။ တခါတရံ အချစ်ဆိုသည်မှာ ခံစားမှုသက်သက်မျှသာ Notting Hillbillies - Will you miss me\n"
"၃။ မရှောင်နိုင်ဘူး ချစ်မိတယ် UB 40 - Can't help falling in love (original Elvis Presley )\n"
"၄။ ၀ိုင်ခွက် ပါးပါး အရက်ပြင်းပြင်း Billy Ray Cyrus - Achy break heart (The Marcy Brothers)\n"
"၅။ လှပသော အမှန်တရား John Cougar - Pretty Woman (Roy Orbison )\n"
"၆။ အနီးအဝေး ပြသနာ The Hooters - 500 miles (The Journey Men )\n"
"၇။ ကံကြမ္မာဇာတ်လမ်း Smokie - Don't play your Rock N Roll to me\n"
"၈။ သံသယ John Lennon - Jealous Guy\n"
"၉။ ဘယ်သူမှ အပြစ်မရှိ ?????\n"
"၁၀။ ခိုလှုံရာ Tom Petty - Spikes\n"
"၁၁။ ယုံကြည်ခြင်း George Michael - Faith\n"
"၁၂။ သံသရာအပြေးသမား ?????\n"
"၁၃။ စွှန့်စားခန်း Steve Earl - Copper road\n"
"၁၄။ အချစ်ရဲ့ ရွှေ Billy Idol - Mony Mony (Tommy James)\n\n"
"ရောခ့်သူရဲကောင်းများ ချစ်ကောင်း + ဇော်ဝင်းထွဋ် -\n"
"၂။ ကျားတွေက မငိုဘူး ( Tokyo Square - Say you will)\n"
"၄။ အိမ်အပြန် ( Bryan Adams - Summer of 69)\n"
"၆။ ကိုယ်လိုလူတွေအများကြီး ( <song-Ao Bpai Loey เอาไปเลย/Take It> <artist - Micro/ไมโคร )\n"
"၈။ မင်းမဟုတ်သလိုပဲ ( Eddie Money - Shakin )\n"
"၁၀။ ပြေးလို့လွတ်မှာလား (Stray Cats - Bring it back again)\n"
"၁၂။ အချစ်မှ ဟုတ်ရဲ့လား Greg Khin Band - With The Naked Eye\n"
"၁၄။ မိုးအောက်မြေပြင် (The Hooters - Johnny B)\n\n"
"မင်္ဂလာပါလောက (ချစ်ကောင်း + ဟေမာနေဝင်း)\n"
"၁။ ချစ်ကောင်း - မင်္ဂလာပါလောက Thai Song\n"
"၃။ ချစ်ကောင်း - အစ်ကိုရေဘာလိုသေးလဲ (The Hooters - Brother don't you walk away)\n"
"၅။ ချစ်ကောင်း - လွမ်းသူ (George Harrison - Gone Troppo)\n"
"၆။ ချစ်ကောင်း - စတော်ဘယ်ရီအိပ်မက် (Smokie - Yesterday dream)\n"
"၁၀။ ချစ်ကောင်း - သံယောဇဉ် (Nick Kamen - Don't hold out)\n"
"၁၂။ ချစ်ကောင်း - ငါ့အချစ်တွေ လျော့ (Marty Straut - Hill Billy rock)\n"
"၁၄။ ချစ်ကောင်း - သေသေချာချာလုပ် (Bonnie Tyler - Hide your heart) original-Ace Frehley\n\n"
"သင်္ကေတ (ချစ်ကောင်း + လေးလေးဝါး)\n"
"၁။ လေးလေးဝါး - ရင်ထဲက ပုဏ္ဍား (Funky Diamonds - I Know That You Want Me)\n"
"၂။ ချစ်ကောင်း + လေးလေးဝါး - ဖြေတော့ (UB 40 + Chrissie Hynde - I Got You Babe) Original - Sony + Cher\n"
"၃။ ချစ်ကောင်း - သင်္ကေတ (Search - Fatansia Bulan Madu) Malasian Song\n"
"၄။ လေးလေးဝါး - အရူးအမူးချစ်မိခြင်း(Celion Dion - Treat Her Like A Lady)\n"
"၅။ ချစ်ကောင်း - မျှော်နေသူအတွက်နောက်ဆုံးည (Eric Camen - Hold Me Now)\n"
"၆။ လေးလေးဝါး - အရိုင်းလေး (Toni Braxton - Un - Breaken My Heart)\n"
"၇။ ချစ်ကောင်း - အလွမ်းဆုံးနေ့ (UB 40 - Here I Am)\n"
"၈။ လေးလေးဝါး - အချစ်ရဲ့ကျေးကျွန်(Malaysian Song)\n"
"၉။ ချစ်ကောင်း - မရှိမဖြစ်.....မရှိ (Damn Yankees - Silence Is Broken)\n"
"၁၀။ လေးလေးဝါး - မရှိတော့မှ (Le Ann Rimes - How Do I live )\n"
"၁၁။ ချစ်ကောင်း - အစွန်းတစ်ဖက် (Wings - Pernafas Oalam Lumpur) Malaysian Song")
matches = re.finditer(regex, test_str, re.MULTILINE | re.DOTALL | re.UNICODE)
for matchNum, match in enumerate(matches, start=1):
print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
for groupNum in range(0, len(match.groups())):
groupNum = groupNum + 1
print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html