Regex matching multiple lines multiple times

前端 未结 2 1553
遇见更好的自我
遇见更好的自我 2021-01-26 13:35

I have a string like this:

Name: John Doe

Age: 23

Primary Language: English

Description: This is a multiline
description field that I want 
to capture

Countr         


        
2条回答
  •  一整个雨季
    2021-01-26 14:20

    Would PHP's strtok help you? You could use it with ":" as the delimeter/token and trim leading and trailing spaces to remove the unwanted new lines.

    http://php.net/manual/en/function.strtok.php

提交回复
热议问题