假设我有像"/grand_parent/parent/child" (三层)或"/parent/child" (两层)这样的树层次结构字符串,"/child" (一级)和"^(/[^/]*)" (一级)可以提取第一级"/grand_parent",如果存在,我想知道是否要提取前两个级别。
"/grand_parent/parent"用于"/grand_parent/parent/child""/parent/child"用于"/parent/child""/child"提取任何内容建议的正则表达式是什么?
https://stackoverflow.com/questions/57384938
复制相似问题