12 Feb 2019

VS2013 Regular Expression Bug? Maybe

收藏到CSDN网摘
I was trying to parse a large file with blocked data using regex library in VS2013. By working in 2 sites, I installed gcc on my Linux machine and VS2013 on Windows. The expression is very simple as "START_INFO[here is the tricky bit]END_INFO", where each block is clearly enclosed by its own start and end information. Inside the [] (square brackets) I'd like to match ALL valid characters. The . (dot) matches almost all but not the newline character and it becomes literal inside the square brackets []. So I came up with an alternative solution "[\s\S]+?" which should guide the program to search all whitespace and non-whitespace characters until it reaches the END_INFO.