PAttern工作正常,测试对象不包含áéãõ 但是,当我尝试使用实际的葡萄牙语 - BR强调文本时,简单地不返回任何匹配项。
尝试改变编码但什么都没有......有什么帮助吗?
HEX Sample imput:50:72:6f:63:65:73:73:6f:20:31:30:35:36:39:32:32:2d:38:34:2e:32:30 :31:33:2E:38:2E :32:36:2E:30:31:30:30:20:2D:20:45:78:65:63:75:C3:A7:C3:A3:1207:20:64:65:20:54 :C3:一 d:74:75:6C:1207:20:45:78:74:72:61:6A:75:64:69:63:69:61:6C:20:2D:20:45:73:70: C3:A9: 63:69:65:73:20:64:65:20:43:1207:6E:74:72:61:74:1207:73:20:2D:20:4D:4F:42:49:4C: 49:4E :53:20:46:4F:52:4D:41:C3:87:C3:83:4F:20:50:52:4F:46:49:53:53:49:4F:4E:41:4C :20:4 5:4D:20:42:45:4C:45:5A:41:20:4C:54:44:41:2E:20:2D:20:4A:55:4C:49:41:4E:41: 20:4D: 41:52:41:4E:48:C3:83:4F:20:50:4F:52:54:4F:20:44:41:20:53:49:4C:56:45:49:52: 41:20 :2D:20:56:69:73:74:1207:73:2E:20:44:65:66:69:72:1207:20:1207:20:70:65:64:69:64:1207米:20:7 0:61:72:61:20:61:20:70:65:73:71:75:69:73:61:20:64:65:20:62:65:6E:73:20:64: 61:20: 70:61:72:74:65:20:72:65:71:75:65:72:69:64:61:20:4A:55:4C:49:41:4E:41:20:4D: 41:52 :41:4E:48:C3:83:4F:20:50:4F:52:54:4F:20:44:41:20:53:49:4C:56:45:49:52:41:2C :20:4 3:50:46:20:30:33:30:2E:37:39:37:2E:35:36:34:2D:39:35:20:28:64:65:63:6C:61: 72:61: C3:A7:C3:A3:1207:20:64:1207:73:20:63:69:6E:63:1207:20:C3:BA:6C:74:69:6D:1207:73:20: 65:78 :65:72:63:C3:广告:63:69:1207:73:29:图2c:20:1207:20:71:75:61:6C:20:C3:A9:20:72:65:61 :6C:6 9:7A:61:64:1207:图2c:20:6E:65:73:74:61:20:64:61:74:61:图2c:20:70:1207:72:20:6D:65: 69:1207: 20:64:65:20:1207:66:C3:广告:63:69:1207:20:65:6E:76:69:61:64:1207:20:C3:A0:20:52:65: 63:65 :69:74:61:20:46:65:64:65:72:61:6C:图2c:20:70:72:1207:74:1207:63:1207:6C:61:64:1207:20 :65:6 C:65:74:72:1207:6E:69:63:61:6D:65:6E:74:65:图2c:20:70:1207:72:20:69:6E:74:65:72: 6D:C3: A9:64:69:1207:20:64:1207:20:73:69:73:74:65:6D:61:20:49:4E:46:4F:4A:55:44:2E:20: 49:6E :74:69:6D:65:2D:73:65:2E:20:2D:20:41:44:56:3A:20:4D:41:54:48:45:55:53:20:44 :45:2 0:4F:4C:49:56:45:49:52:41:20:54:41:56:41:52:45:53:20:28:4F:41:42:20:31:36: 30:37: 31:31:2F:53:50:29:50:72:1207:63:65:73:73:1207:20:31:30:35:36:39:32:32:2D:38:34: 2E:32 :30:31:33:2E:38:2E:32:36:2E:30:31:30:30:20:2D:20:45:78:65:63:75:C3:A7:C3:A3 :6F:2 0:64:65:20:54:C3:广告:74:75:6C:1207:20:45:78:74:72:61:6A:75:64:69:63:69:61:6C: 20:2D: 20:45:73:70:C3:A9:63:69:65:73:20:64:65:20:43:1207:6E:74:72:61:74:1207:73:20:2D: 20:4D :4F:42:49:4C:49:4E:53:20:46:4F:52:4D:41:C3:87:C3:83:4F:20:50:52:4F:46:49:53 :53:4 9:4F:4E:41:4C:20:45:4D:20:42:45:4C:45:5A:41:20:4C:54:44:41:2E:20:2D:20:4A: 55:4C: 49:41:4E:41:20:4D:41:52:41:4E:48:C3:83:4F:20:50:4F:52:54:4F:20:44:41:20:53: 49:4C :56:45:49:52:41:20:2D:20:56:69:73:74:1207:73:2E:20:31:29:20:43:69:C3:AA:6E:63 :69:6 1:20:64:61:20:72:65:73:70:1207:73:74:61:20:64:1207:20:1207:66:C3:广告:63:69:1207:20: 65:78: 70:65:64:69:64:1207:20:C3:A0:20:52:65:63:65:69:74:61:20:46:65:64:65:72:61:6C: 2C:20 :66:69:63:61:6E:64:1207:20:1207:73:20:64:61:64:1207:73:20:73:69:67:69:6C:1207:73:1207米:73:2 0:61:72:71:75:69:76:61:64:1207:73:20:65:6D:20:70:61:73:74:61:20:70:72:C3:B3: 70:72: 69:61:2E:20:32:29:20:50:1207:72:20:63:1207:6E:73:65:67:75:69:6E:74:65:图2c:20:61: 20:70 :61:72:74:65:20:65:78:65:71:75:65:6E:74:65:20:64:65:76:65:20:6D:61:6E:69:66 :65:7 3:74:61:72:2D:73:65:图2c:20:65:6D:20:63:69:6E:63:1207:20:64:69:61:73:2E:20:4E: 1207:20: 73:69:6C:C3:AA:6E:63:69:1207:图2c:20:61:1207:20:61:72:71:75:69:76:1207:2E:20:49:6e中: 74:69 :6D:65:2D:73:65:2E:20:2D:20:41:44:56:3A:20:4D:41:54:48:45:55:53:20:44:45:20 :4F:4 C:49:56:45:49:52:41:20:54:41:56:41:52:45:53:20:28:4F:41:42:20:31:36:30:37: 31:31: 2F:53:50:29:50:72:1207:63:65:73:73:1207:20:31:30:35:37:32:38:30:2D:31:35:2E:32: 30:31 :34:2E:38:2E:32:36:2E:30:31:30:30
答案 0 :(得分:0)
这与重音字符无关。提供给您的answer无效,因为:
re.findall
而不是re.match
(实际上,因为旧输入也有几个实例,该解决方案赢了&# 39;在那里完美地工作。)因此,这是正确的解决方案:
>>> print input
Processo 1056922-84.2013.8.26.0100 - Execução de Título Extrajudicial - Espécies de Contratos - MOBILINS FORMAÇÃO PROFISSIONAL EM BELEZA LTDA. - JULIANA MARANHÃO PORTO DA SILVEIRA - Vistos. Defiro o pedido para a pesquisa de bens da parte requerida JULIANA MARANHÃO PORTO DA SILVEIRA, CPF 030.797.564-95 (declaração dos cinco últimos exercícios), o qual é realizado, nesta data, por meio de ofício enviado à Receita Federal, protocolado eletronicamente, por intermédio do sistema INFOJUD. Intime-se. - ADV: MATHEUS DE OLIVEIRA TAVARES (OAB 160711/SP)Processo 1056922-84.2013.8.26.0100 - Execução de Título Extrajudicial - Espécies de Contratos - MOBILINS FORMAÇÃO PROFISSIONAL EM BELEZA LTDA. - JULIANA MARANHÃO PORTO DA SILVEIRA - Vistos. 1) Ciência da resposta do ofício expedido à Receita Federal, ficando os dados sigilosos arquivados em pasta própria. 2) Por conseguinte, a parte exequente deve manifestar-se, em cinco dias. No silêncio, ao arquivo. Intime-se. - ADV: MATHEUS DE OLIVEIRA TAVARES (OAB 160711/SP)Processo 1057280-15.2014.8.26.0100
>>> regex = re.compile('(Processo \\d{7}\\-\\d{2}\\.\\d{4}\\.\\d+\\.\\d{2}\\.\\d{4}.*?)(?=Processo)|(Processo \\d{7}\\-\\d{2}\\.\\d{4}\\.\\d+\\.\\d{2}\\.\\d{4}.*)')
>>> regex.findall(y)
[('Processo 1056922-84.2013.8.26.0100 - Execu\xc3\xa7\xc3\xa3o de T\xc3\xadtulo Extrajudicial - Esp\xc3\xa9cies de Contratos - MOBILINS FORMA\xc3\x87\xc3\x83O PROFISSIONAL EM BELEZA LTDA. - JULIANA MARANH\xc3\x83O PORTO DA SILVEIRA - Vistos. Defiro o pedido para a pesquisa de bens da parte requerida JULIANA MARANH\xc3\x83O PORTO DA SILVEIRA, CPF 030.797.564-95 (declara\xc3\xa7\xc3\xa3o dos cinco \xc3\xbaltimos exerc\xc3\xadcios), o qual \xc3\xa9 realizado, nesta data, por meio de of\xc3\xadcio enviado \xc3\xa0 Receita Federal, protocolado eletronicamente, por interm\xc3\xa9dio do sistema INFOJUD. Intime-se. - ADV: MATHEUS DE OLIVEIRA TAVARES (OAB 160711/SP)', ''), ('Processo 1056922-84.2013.8.26.0100 - Execu\xc3\xa7\xc3\xa3o de T\xc3\xadtulo Extrajudicial - Esp\xc3\xa9cies de Contratos - MOBILINS FORMA\xc3\x87\xc3\x83O PROFISSIONAL EM BELEZA LTDA. - JULIANA MARANH\xc3\x83O PORTO DA SILVEIRA - Vistos. 1) Ci\xc3\xaancia da resposta do of\xc3\xadcio expedido \xc3\xa0 Receita Federal, ficando os dados sigilosos arquivados em pasta pr\xc3\xb3pria. 2) Por conseguinte, a parte exequente deve manifestar-se, em cinco dias. No sil\xc3\xaancio, ao arquivo. Intime-se. - ADV: MATHEUS DE OLIVEIRA TAVARES (OAB 160711/SP)', ''), ('', 'Processo 1057280-15.2014.8.26.0100')]
如果两个输入都是合法的(即输入可能包含单词 Process 并且可能包含单词 Processo ),则应使用此正则表达式:
>>> regex = re.compile('(Processo? \\d{7}\\-\\d{2}\\.\\d{4}\\.\\d+\\.\\d{2}\\.\\d{4}.*?)(?=Processo?)|(Processo? \\d{7}\\-\\d{2}\\.\\d{4}\\.\\d+\\.\\d{2}\\.\\d{4}.*)')