Home > Software engineering >  The same regular expression is not the same results
The same regular expression is not the same results

Time:10-02

Is writing a piece of code that matches a regular expression is
Const char * pattern="^ \ \ s * WHILE \ \ s + I F [B] [a-z] * [0-9] * \ \ s * [& lt; & gt;!=]=? [B] I F \ \ s * * [a-z] [0-9] * \ \ s */+ - */\ \ s * I F [B] [a-z] * [0-9] * \ \ s * $
"Matching the string is "WHILE BSDF45== BKFS56
BSDF45 character must be a or B or I F ", BKFS56, BSD9 is also a with B, I, F ", the first BSDF45 and third BSD9 if with other capital letter, match the return value 1, which is not match, but if BKFS56 if by other capital letter, the second match is successful and will have eldest brother, the younger brother is a novice, can you help me? I also use the Internet online matching of regular expressions, the result is the same, a project on hand just use regular expressions, for help,,,,

CodePudding user response:

^ WHILE \ \ s * s + I F [B] [a-z] * [0-9] * \ s * [& lt; & gt;!=]=? I F \ s * [B] [a-z] * [0-9] * \ s * [+ - */] [B] I F \ s * * [a-z] [0-9] * \ s * $standard is such,

CodePudding user response:

Regular expression quick study regular expressions, for example, regular expressions (4 pages of A4 paper) http://download.csdn.net/detail/zhao4zhong1/1808549
  • Related