简体   繁体   中英

blank in regular expression in flex

I have the following regular expression in a flex file. (.l file)

  doctype [[:blank:] \r\n]*<!DOCTYPE[^\[]*\[[[:blank:] \r\n]*

From a flex tutorial, in the pattern chapiter, I saw that flex defines '[:blank:]' as a blank or a tab.
But in the expression above, why do we need another blank after [:blank:] ?

The [:blank:] POSIX character class matches a space or a tab (even in the FLEX patterns manual ).

Thus, the [[:blank:] \\r\\n] character class equals [[:blank:]\\r\\n] .

Same as [rr] = [r] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM