Regex with possible empty matches and multi-line match

后端 未结 4 1087
猫巷女王i
猫巷女王i 2021-01-23 22:28

I\'ve been trying to \"parse\" some data using a regex, and I feel as if I\'m close, but I just can\'t seem to bring it all home.
The data that needs parsing gener

4条回答
  •  面向向阳花
    2021-01-23 23:01

    i'm pretty new to PHP so maybe this is totally out of whack, but maybe you could use something like

    $data = <<

    yields

    Array
    (
        [FooID:] =>  123456
        [Name:] =>  Chuck
        [When:] =>  01/02/2013 01:23:45
        [InternalID:] =>  789654
        [User Message:] =>  Hello,
    this is nillable, but can be quite long. Text can be spread out over many     lines
    And can start with any number of 
    's. It can be empty, too
    )
    

提交回复
热议问题