# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(\d+\.\s)"
test_str = ("Curious about what's in store for you? Tap into the wisdom of the cosmos now by reading your daily horoscope! 🔮\n"
"Want to know what the universe has planned for you? Uncover your celestial forecast by clicking here! 🌠\n"
"Feel the pulse of the planets! Dive into your daily horoscope now - the stars are waiting to guide you! 🌟\n"
"Align with the stars! Discover the cosmic insights tailored to you by reading your daily horoscope here! 🌌\n"
"The secrets of your day are written in the stars. Dare to discover them? Click here for your daily horoscope! ✨\n"
"Your zodiac sign holds the key to your day. Unlock its secrets now by reading your daily horoscope here! 🗝️\n"
"What do the stars have to say about your destiny today? Find out by clicking here for your daily horoscope! 🌠\n"
"Embrace your celestial journey! Navigate your day with confidence by reading your daily horoscope here! 🌌\n"
"1. Navigate your cosmic pathway! Tap here to explore your daily horoscope. 🌌\n"
"2. Embrace the mysteries of the universe. Uncover your daily horoscope now! 🔮\n"
"3. Are you ready to align with the stars? Click here to decode your daily horoscope! 🌠\n"
"4. Wondering what the stars have in store for you? Find out by reading your daily horoscope! 🌟\n"
"5. Your day, decoded by the stars! Click here to access your daily horoscope. 🌞\n"
"6. Illuminate your path with the wisdom of the cosmos! Read your daily horoscope here! ✨\n"
"7. Make the most of your day with stellar guidance! Check out your daily horoscope now! 🌌\n"
"8. Unlock the secrets of the skies! Click here to explore your daily horoscope. 🌠\n"
"9. Chart your course with the stars! Read your daily horoscope now! 🌟\n"
"10. Explore the mysteries of the cosmos. Check out your daily horoscope here! 🌌\n"
"11. Ready to step into your destiny? Click here to discover your daily horoscope! 🔮\n"
"12. Let the stars be your guide. Uncover your daily horoscope now! 🌠\n"
"13. Your celestial journey begins here! Dive into your daily horoscope! 🌞\n"
"14. Unleash the power of the zodiac! Discover your daily horoscope here! 🌟\n"
"15. Embark on your stellar journey! Tap here for your daily horoscope! 🌌\n"
"16. Want to know what the cosmos has in store for you? Find out with your daily horoscope! 🌠\n"
"17. The stars hold the key to your day! Unlock it with your daily horoscope! 🔑\n"
"18. Take a cosmic snapshot of your day! Check out your daily horoscope here! 🌟\n"
"19. Set your course by the stars! Click here to access your daily horoscope! 🌌\n"
"20. Navigate the celestial winds! Discover your daily horoscope now! 🌠\n"
"21. Your stars, your story! Dive into your daily horoscope here! 🌞\n"
"22. Unveil the cosmic curtain! Find out what's in store with your daily horoscope! 🌟\n"
"23. The cosmos is calling! Answer with your daily horoscope! 🌌\n"
"24. The universe has a message for you! Decode it with your daily horoscope! 🔮\n"
"25. Let the planets plot your path! Click here to read your daily horoscope! 🌠\n"
"26. The cosmos whispers wisdom to you! Listen by reading your daily horoscope! 🌞\n"
"27. Unlock the cosmic code of your day! Check your daily horoscope here! 🌟\n"
"28. What does the celestial sphere hold for you? Find out with your daily horoscope! 🌌\n"
"29. The secrets of the stars await you! Unveil them with your daily horoscope! 🔮\n"
"30. Chart your celestial journey! Click here for your daily horoscope! 🌠\n"
"31. Read the stellar script of your day! Access your daily horoscope now! 🌞\n"
"32. The zodiac holds the keys to your day. Unlock them with your daily horoscope! 🌟\n"
"33. The stars are waiting to guide you! Discover their secrets with your daily horoscope! 🌌\n"
"34. What do the heavens have in store for you? Find out by checking your daily horoscope! 🔮\n"
"35. Walk your stellar path with confidence! Click here for your daily horoscope! 🌠\n"
"36. Uncover the cosmic clues to your day! Read your daily horoscope here! 🌞\n"
"37. Let the celestial sphere guide you! Access your daily horoscope now! 🌟\n"
"38. Hear the whispers of the cosmos! Click here to explore your daily horoscope! 🌌\n"
"39. Want to know what the universe whispers? Discover it with your daily horoscope! 🔮\n"
"40. Discover the stellar symphony of your day! Click here for your daily horoscope! 🌠\n"
"41. Navigate the zodiac with the stars as your guide! Read your daily horoscope now! 🌞\n"
"42. Want a cosmic forecast of your day? Click here to discover your daily horoscope! 🌟\n"
"43. What celestial secrets does your day hold? Uncover them with your daily horoscope! 🌌\n"
"44. Step into the cosmos! Click here to access your daily horoscope! 🔮\n"
"45. Unveil your stellar story! Discover your daily horoscope here! 🌠\n"
"46. Curious about the celestial forecast for your day? Find out with your daily horoscope! 🌞\n"
"47. Let the cosmos be your guide! Dive into your daily horoscope here! 🌟\n"
"48. The stars have a message for you! Decode it with your daily horoscope! 🌌\n"
"49. What secrets do the stars hold for you? Find out with your daily horoscope! 🔮\n"
"50. Embark on a cosmic journey! Explore your daily horoscope here! 🌠")
matches = re.finditer(regex, test_str)
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