How to skip first regex match?

后端 未结 4 2017
伪装坚强ぢ
伪装坚强ぢ 2020-12-22 01:55

Is there anyway to skip the first match when using regex and php.

Or is there some way of achieveing this using str_replace.

Thanks

UPDATE

4条回答
  •  渐次进展
    2020-12-22 02:23

    Easy PHP way:

    
    

    will give you "AN".

    UPDATE: Didn't know it was a replace. Try this:

    
    

    Find the first match and remember where it was, then delete everything, then put whatever was in the first spot back in.

提交回复
热议问题