regular expression on stream instead of string?

后端 未结 3 532
深忆病人
深忆病人 2020-12-19 08:25

Suppose you want to do regular expression search and extract over a pipe, but the pattern may cross multiple lines, How to do it? Maybe a regular expression library work for

3条回答
  •  Happy的楠姐
    2020-12-19 09:12

    I do not believe that it is possible to use a regular expression on a stream, because without an entire piece of data, you cant make a positive match. This means that you would only have a probable match.

    However, as @James Henstridge stated, you could use buffers to overcome this.

提交回复
热议问题