I'm trying to get this regex to work where i want studio
to match www.mysite.com/[slug]/[slug]/ourclasses
, second slug. This is what i've come up with so far. Problem is that it removes the slug and only returns www.mysite.com/ourclasses
.
add_rewrite_rule(
'/([A-Za-z0-9-]*)/ourclasses?','/index.php?pagename=ourclasses&studio=$matches[1]','top'
);
How would i write the regex?
CodePudding user response:
Then I believe you're pattern should look like this :
(?<=/)\w (?=/\w $)