0

I need regular expression for something like: abc.xyz (firstname.lastname) I have tried [a-zA-Z ]*$\.[a-zA-Z ]*$ but it does not work.

Update

My actual requirement is to add user's firstname.lastname in url to get something like:

www.abc.com/simer.pqr/profile

This I have to do for django(python) project. Therefore need regular expression.

For the exact requirement I have posted another question SO question - rewrite django url

Community
  • 1
  • 1
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112

1 Answers1

0

$ means end of string, so you should not use it inside your string.

Your URL regexp should look like ^(P?<fname>[^.]+)\.(?P<lname>[^/]+)/profile$

atn
  • 904
  • 9
  • 17