网址:
http://www.abc.com/aa/123123.SZ/1/16/42/aa_16_6/
http://www.abc.com/bb/123123.SZ/
http://www.abc.com/cc/123123.SH/99/
网址类型没有规律,但其中都包含上市公司证券代码123123.SH,也可能是123123.SZ:
6位数字+一个点+2位字母,现在需提取这个公司代码,然后替换成其他公司代码,如下:
http://www.abc.com/aa/222222.SH/1/16/42/aa_16_6/
http://www.abc.com/bb/222222.SH/
http://www.abc.com/cc/222222.SH/99/
请问通过js如果通过正则实现呢?