The problem of finding a regular expression

re.findall ("[u4E00-u9FFF | () ()] {5jue 20} Co., Ltd. | [u4E00-u9FFF | () ()] {5jue 20} Co., Ltd.)

["Insurance brokerage companies may use limited liability companies or joint stock limited companies")
["Insurance brokerage companies may use limited liability companies or joint stock limited companies"]

you can"t have a "limited liability company" at the same time. "Why is there not a" | "or only one match here?


a | b does not mean that it can only match an or b, but can match strings containing a, b, and ab. It is more troublesome to use indexOf to match an expression with only one ab in a string.

Menu