Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python In Lunix
#2
Start with something simple, that you can test over and over, like maybe this:

import re

regex = re.compile(r"your-regex-here")

test_strings = [
  "Jose",
  "Jjunior",
  "4chr",
  "letters",
  "ending-in-number5",
  "athenbthenc",
  "Capital",
  "doesn'tmatch@nyth1ng"
]
I'd suggest using something like regexpal (http://www.regexpal.com/) to test out your regex quickly to find something that works for each case.
But really, there's almost no python involved here... it's all just regular expressions.
Reply


Messages In This Thread
Python In Lunix - by Wizard - May-11-2017, 03:38 PM
RE: Python In Lunix - by nilamo - May-11-2017, 03:55 PM
RE: Python In Lunix - by Wizard - May-11-2017, 04:54 PM
RE: Python In Lunix - by nilamo - May-11-2017, 05:00 PM
RE: Python In Lunix - by Wizard - May-11-2017, 05:59 PM
RE: Python In Lunix - by wavic - May-11-2017, 07:52 PM
RE: Python In Lunix - by Wizard - May-11-2017, 09:07 PM
RE: Python In Lunix - by nilamo - May-11-2017, 09:15 PM
RE: Python In Lunix - by Ofnuts - May-12-2017, 09:52 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020