久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

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

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

瀏覽:128日期: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 編程
主站蜘蛛池模板: 合川市| 抚宁县| 龙井市| 株洲县| 西安市| 海兴县| 刚察县| 台南市| 高要市| 吉安市| 延寿县| 天等县| 武宁县| 图木舒克市| 定远县| 小金县| 河西区| 深圳市| 吉木乃县| 常山县| 理塘县| 出国| 白山市| 遂川县| 湘阴县| 双柏县| 石楼县| 平泉县| 丹阳市| 瑞金市| 宜丰县| 如皋市| 新密市| 电白县| 揭阳市| 安溪县| 济宁市| 乐陵市| 乌兰察布市| 牟定县| 吉水县|