title/x/word/c
How do I match something after /x/ but before the next one / ? (i.e. match word )
/x/
/
word
\/x\/.+\/ matches /x/word/ , but I'm not sure how to match correctly word (new for regex)
\/x\/.+\/
/x/word/
Use appearance and negative character class:
(?<=/x/)[^/]*
Watch live demo .
Take a look around without participating in the match.
/x/([^/]*)
This is a simple regular expression. We are matching /x/ , followed by zero or more characters that are not / . You just add the parentheses where you want to add the capture group.