Regex - Matching text AFTER certain characters

后端 未结 4 1476
梦如初夏
梦如初夏 2020-12-19 01:15

I want to scrape data from some text and dump it into an array. Consider the following text as example data:

| Example Data
| Title: This is a sample title
|         


        
4条回答
  •  渐次进展
    2020-12-19 01:39

    You could change it to:

    /: (.+)/
    

    and grab the contents of group 1. A lookbehind works too, though, and does just what you're asking:

    /(?<=: ).+/
    

提交回复
热议问题