3

Forgive my title not being more exact...I need a (simple?) Regex (which I'm awful at) to match the following

/Parent/AnySubDirectory/Child/

Parent and Child are always Parent and Child. Any subdirectory could have any name:

/Parent/Sub1/Child/
/Parent/Sub2/Child/

Everything I research is more complicated than necessary.

4

1 に答える 1

9
/Parent/[^/]+/Child/

動作するはずです。

[^/]+「スラッシュを除く 1 つ以上の文字」を意味します。

于 2012-08-24T19:37:04.553 に答える