开发者

look behind for this REGEX?

im putting the delimiter i want to split by in caps just so they will stand out code should search for upper or lowercase

$ReadStr = 'asbhd dbshd ABC/DEF sdjfhjskjhfh hfjhd fkj GHI/JKL sdhjkjhfg'; 

this is what I have...

$SplitStr = preg_split("[开发者_JAVA技巧.../+...]",$ReadStr);

print_r($SplitStr);

would output:

asbhd dbshd
sdjfhjskjhfh hfjhd fkj
sdhjkjhfg

just not sure how to implement the look behind the same exact regex expression...

this is the output i'm looking for:

asbhd dbshd 
ABC/DEF sdjfhjskjhfh hfjhd fkj 
GHI/JKL sdhjkjhfg


Use a look-ahead instead:

/(?=...\/+...)/

Or to be more specific:

/(?=[a-z]{3}\/+[a-z]{3})/i
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜