Một vài regular expression hữu ích cho địa chỉ

Text: [A-Za-z0-9 ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚĂĐĨŨƠàáâãèéêìíòóôõùúăđĩũơƯĂẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼỀỀỂưăạảấầẩẫậắằẳẵặẹẻẽềềểỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪễệỉịọỏốồổỗộớờởỡợụủứừỬỮỰỲỴÝỶỸửữựỳỵỷỹ]
Phường: Phường|phường|P\.|p\.|Ward|ward
-----------------------
(?<=ipsum\s)(\w+) match any character after ipsum
-----------------------
(?<=\d\s)[A-Za-z ]+:
match any vietnamese character after number
-----------------------
[A-Za-z ]+(?=(phuong))
match any vietnamese character before Phường|phường|P\.|p\.|Ward|ward
-----------------------
((?<=\d\s)[A-Za-z ]+)([A-Za-z ]+(?=( phuong)))
match any vietnamese character after number and before ' phuong'
-----------------------
((?<=\d\s)[A-Za-z ]+)([A-Za-z ]+(?=( phuong)))|((?<=\d\s)[A-Za-z ]+)([A-Za-z ]+(?=( quan)))
if have ' phuong' will get all character before it else will get if have ' quan'
-----------------------
30 Tran hung dao phuong binh an quan 1 | ((?<=\d\s)[A-Za-z ]+)([A-Za-z ]+(?=( phuong)))
11 Tran nguyen han quan 1 TPHCM ((?<=\d\s)[A-Za-z ]+)([A-Za-z ]+(?=( quan)))
Phong 520 chung cu Van Lang, Tran Hung dao, Phuong An Phu, Quan 2
Lo 1 Khu dan cu Van Minh, Phuong Binh An, Quan 2.
Nguyen Van Luong, Quan 2.
A5B Pham Van Quyen, Quan 2
Advertisements

2 thoughts on “Một vài regular expression hữu ích cho địa chỉ

  1. I’ve been exploring for a bit for any high quality articles or blog posts on this kind of area . Exploring in Yahoo I eventually stumbled upon this site. Studying this information So i’m happy to show that I’ve a very just right uncanny feeling I came upon exactly what I needed. I most undoubtedly will make certain to do not overlook this website and give it a glance regularly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s