Combining 2 regexes to 1

N

Niklasro(.appspot)

Hello, Suspecting it's completely doable combining these 2 regexes to
just 1 expression I'm looking for the working syntax. If you know then
kindly inform. Thanks in advance
('/a/([^/]*)',List), #list
('/a([^/]*)',List), #list
Niklas Rosencrantz
 
C

Chris Rebert

Hello, Suspecting it's completely doable combining these 2 regexes to
just 1 expression I'm looking for the working syntax. If you know then
kindly inform. Thanks in advance
('/a/([^/]*)',List), #list
('/a([^/]*)',List), #list

Er,

/a(/?)([^/]*)

?

Cheers,
Chris
 
M

MRAB

Hello, Suspecting it's completely doable combining these 2 regexes to
just 1 expression I'm looking for the working syntax. If you know then
kindly inform. Thanks in advance
('/a/([^/]*)',List), #list
('/a([^/]*)',List), #list

('/a/?([^/]*)', List), #list
 
N

Niklasro(.appspot)

Many thanks. It works. You also helped me refactor these

('/([0-9]*)/?([^/]*)',AById),#id2a
('/([0-9]*)',AById)

to just 1

('/([0-9]*)/?([^/]*)',AById),#id2a

It's from the appspot framework.
Sincerely
Niklas R
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top