Regex to extract only text after string and before space

前端 未结 3 1314
南方客
南方客 2020-12-28 16:28

I want to match text after given string. In this case, the text for lines starting with \"BookTitle\" but before first space:

BookTitle:HarryPotter JK Rowli         


        
3条回答
  •  粉色の甜心
    2020-12-28 17:04

    With the 'multi-line' regex option use something like this:

     ^BookTitle:([^\s]+)  
    

    Without multi-line option, this:

     (?:^|\n)BookTitle:([^\s]+)
    

提交回复
热议问题