国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

Python正則表達式問題,(?i)什么意思

瀏覽:129日期:2022-07-02 18:25:08

問題描述

filter(re.compile(’(?i)([qwertyuiop]|[asdfghjkl]|[zxcvbnm]*)$’).match, words)如上,這是一個Python語句,(?i)什么意思?

問題解答

回答1:

(?aiLmsux) (One or more letters from the set ’a’, ’i’, ’L’, ’m’, ’s’, ’u’, ’x’.) The group matches the empty string; the letters set the corresponding flags: re.A (ASCII-only matching), re.I (ignore case), re.L (locale dependent), re.M (multi-line), re.S (dot matches all), and re.X (verbose), for the entire regular expression. (The flags are described in Module Contents.) This is useful if you wish to include the flags as part of the regular expression, instead of passing a flag argument to the re.compile() function.

Note that the (?x) flag changes how the expression is parsed. It should be used first in the expression string, or after one or more whitespace characters. If there are non-whitespace characters before the flag, the results are undefined.

忽略大小寫

標簽: Python 編程
主站蜘蛛池模板: 九龙坡区| 嘉善县| 木里| 南昌市| 嘉黎县| 青河县| 施秉县| 湖南省| 东丽区| 延安市| 奉化市| 文山县| 镇沅| 峨边| 扶绥县| 施甸县| 古蔺县| 湛江市| 庆元县| 孟津县| 土默特左旗| 信丰县| 台湾省| 涪陵区| 金湖县| 巴楚县| 乌兰浩特市| 宣武区| 宜兰市| 盐亭县| 四川省| 汉阴县| 军事| 伊通| 裕民县| 仁化县| 巴东县| 吉林市| 称多县| 东至县| 通河县|