REGEX FOR "last value is number"

gcomm

Client
Регистрация
01.03.2011
Сообщения
332
Благодарностей
93
Баллы
28
I have a string ...

data|G1R 1M9|montreal|Quebec|QC|


The regex to get the postal code is as follows (montreal is the execution result)
(?<=\|).*(?=\|{-FieldData.FieldData-|-●1●5●0●9●1●3●-|-≡1≡8≡6≡0≡3≡1≡0≡6≡1≡7≡-})


How to specify the the regex match should contain numeric values somewhere within the string OR
How to specify the ending digit I am looking for G1R 1M9 <--- in the case, should be present... More of curiosity than necessity... an instance occurred when

data|G1R 1M9|quebec|Quebec|QC| <---- was present- since it is a city and a province(state)-


Just throwin' it out there for the regex pimps... enjoy.
 

propostaff

Client
Регистрация
04.01.2011
Сообщения
74
Благодарностей
3
Баллы
8
(?<=\|).*?(?=\|)-|-1
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)