Regex to split a string only by the last whitespace character

后端 未结 3 1944
清酒与你
清酒与你 2021-02-07 19:33

hopefully this should be a quick and simple one, using PHP I\'m trying to split a string into an array but by only the last instance of whitespace. So far I have...



        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 19:50

    If the * and + after \S dupicated? Only /\s+(?=\S+$)/ or /\s+(?=\S*$)/ is enough depends on the need.

提交回复
热议问题