WordPress Custom Taxonomy With Same Slug As Custom Post Type

If you want the Terms in your Custom Taxonomy to have their URL path containing their Custom Post Type slug instead of Custom Taxonomy slug without showing 404 page, that can be a little tricky, and as I found throughout the blogs and forums quite impossible.

But, fortunately, it is possible! And it is really quite simple (although it took me a whole day and a lot of nerves to figure it out).

URL Regular Expression & JavaScript Link Shortener

Detecting URLs in text strings is something that you will probably need sometime when parsing some text in your applications, and their shortening can also be quite handy (like Twitter does for example).

Matching URLs is not so difficult, but matching them and grouping all URL fragments is. Especially if you want to do that in one match. So, here is one URL Regular Expression to rule them all.