In the project, you need to match the merchant's address. The key is to retrieve the user's path name. The user's address is an existing one. You only need to filter the outlet name from the existing address. Below is the Javascript Code Implementation: < Script >
VaR Reg = / (. *? ) [No. Building Road in the city district] / IG;
VaR Address0 = " No. 515, Yangpu district, guoding Road, Shanghai " ;
VaR Address1 = " In the kongjia garden, building 4, No. 2421, xietu Road, Xuhui District " ;
VaR Address2 = " 11-13, 6/F, zhengda Plaza, No. 168 Lujiazui West Road, Pudong New Area, Shanghai " ;
VaR Address3 = " 11-13, 6/F, zhengda Plaza, No. 168 Lujiazui West Road " ;
VaR Address4 = " 50/F haishen Hotel, 728 Pudong Avenue, Pudong New Area, Shanghai " ;
VaR Address5 = " Near Zhangjiang Metro, Pudong, Shanghai "
VaR Address = Address2;
// Press [Street roads in the City Lane]
VaR Result = Address. Match (REG );
If (Result)
{
// Search for matched results in the group
For ( VaR I = 0 ; I < Result. length; I ++ )
{
If (Result [I]. Match ( / (. +? ) [Path] / ))
{
Address = Result [I];
}
}
}
Alert (Address );
</ Script >