Regular Expressions 101

Community Library

1

Chinese Digits

Created·2024-01-05 07:56
Updated·2024-02-06 07:02
Type·Match
Flavor·PCRE (Legacy)
Match Chinese Digits less than 1×10^16, such as “一千两百三十四万”、“八萬点七六五”、“玖仟玖佰玖拾玖万玖仟玖佰玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖点玖玖玖玖玖玖玖玖玖玖玖玖玖玖玖玖”,Upper and lower case Chinese can be mixed, but Chinese numbers and English numbers cannot be mixed. Illegal numbers will not be matched. For example: “两十六” will not be matched, as the correct one should be “二十六”,In general Chinese, “两” and “十” are not used together; “两千零零六” will not be matched, as the correct one should be “两千零六”,as consecutive "零" in the integer part of Chinese numbers are illegal. It need a regex engine that supports the functionality of matching an expression defined in a named capture group, such as "(?[a-z]+)\d+(&letter)". 用于匹配小于1×10^16的中文数字,例如:“一千两百三十四万”、“八萬点七六五”、“玖仟玖佰玖拾玖万玖仟玖佰玖拾玖亿玖仟玖佰玖拾玖万玖仟玖佰玖拾玖点玖玖玖玖玖玖玖玖玖玖玖玖玖玖玖玖”,大小写中文数字可以混用,中文数字与英文数字不可以混用。 不合法的中文数字不会被匹配,例如:“两十六”、“两十六万”不会被匹配,因为中文习惯中不将“两”与“十”连用;“两千零零六”不会被匹配,因为其中有连续的零。 需要引擎支持引用已定义组的表达式,例如:"(?[a-z]+)\d+(&letter)"。
Submitted by Anonymous
-1

pesquisa_cautelar

Created·2023-07-14 19:37
Type·Match
Flavor·PCRE (Legacy)
Array ( [0] => Página 1 de 5 MEGA [1] => Código da Consulta: 15240795 [2] => MEGA15240795VIS\bKdKd>Z/Z\bOPRETOAGJ3548,SP,MEGA15240795VIS\bKdKd>Z/Z\bOPRETOAGJ3548,SP,MEGA15240795VIS\bKdKd>Z/Z\bOPRETOAGJ3548,SP,MEGA15240795VIS\bKdKd>Z/Z\bOPRETOAGJ3548,SP,MEGA15240795VIS\bKdKd>Z/Z\bOPRETOAGJ3548,SP,MEGA1 [3] => Data da Pesquisa: quinta-feira, 7 de julho de 2022 - 16:31:59 Data da Impressão: quarta-feira, 12 de julho de 2023 - 11:31:35 [4] => VW VW FUSCA 1600 [5] => MARCA/MODELO: VW VW FUSCA 1600 [6] => ANO FAB/MODELO: 1996 / 1996 [7] => RENAVAM: 00658362895 COMBUSTIVEL: GASOLINA [8] => CHASSI: 9BWZZZ113TP004878 [9] => PLACA: AGJ3548 [10] => COR: AMARELA [11] => CILINDRADAS: 0 [12] => MEGA BASE ESPECIAL [13] => [14] => RESUMO DAS PRINCIPAIS BASES ABAIXO [15] => RESTRIÇÕES ESTADUAL [16] => MULTAS E DÉBITOS [17] => SINISTRO [18] => HISTÓRICO DE LAUDO DE MOTOR LEIL\bO [19] => HISTÓRICO DE ROUBO E FURTO [20] => HISTÓRICO DE CONSULTAS [21] => HISTÓRICO DE LAUDO CAUTELAR [22] => ANO FABRICAÇ\bKP 1996 [23] => MARCA MODELO: VW VW FUSCA 1600 [24] => COMBUSTIVEL: GASOLINA [25] => TIPO VEICULO: AUTOMOVEL ANO MODELO: 1996 [26] => COR: AMARELA [27] => ESPÉCIE VEICULO: PASSAGEIRO [28] => CATEGORIA VEICULO: PARTICULAR [29] => PASSAGEIROS: 5 [30] => CILINDRADAS: 0 [31] => CAPACIDADE DE CARGA 0,00 [32] => QUANTIDADE DE EIXOS: 0 PROCEDÊNCIA VEICULO: NACIONAL [33] => POTÊNCIA: 53 [34] => CMT/PBT VEÍCULO: 0 / / 0 [35] => FICHA CADASTRAL [36] => DATA EMISS\bKZsP 31/05/2007 DATA LICENCIAMENTO: 04/01/2022SINISTRO [37] => ESPECIAL ROUBO E FURTO SINISTRO / [38] => ACIDENTE REMARKETING SEGURADORA / [39] => FINANCEIRA [40] => [41] => Página 2 de 5 EXER. LICENCIAMENTO: 2022 [42] => PLACA ATUAL: AGJ3548 [43] => UF PLACA: SP [44] => CHASSI 9BWZZZ113TP004878 RENAVAM: 00658362895
Submitted by emerson

Community Library Entry

3

Regular ExpressionOpen Workspace

/
\/\*(?!(\<\!\[CDATA\[)|(\]\]>))(.*?)\*\/
/
gs

Description
Created·2013-03-21 20:42
Type·Match
Flavor·PCRE (Legacy)

This regular expression removes multi-line (star) comments from JavaScript, while leaving any CDATA sections intact. Use the global (g) modifier to match them all (if you plan to use PHP's preg_replace, the g modifier is not necessary), and use the (s) modifier to make dots match newlines (this will be required in for using with PHP's preg_replace function). This regular expression does not exhaust all possibilities (such as a space between the opening or closing star comment and the CDATA tag), but it functions if the style guidelines are of the more popularized variety.

Submitted by Dane MacMillan
Open Workspace