需要正则表达式的帮助
var s = "left=123,top=345,width=123, height= 34, center=yes, help=no,resizable=yes, status=now";
需要获取所有参数(名称 -> 值)
试过这种方式/(\w+)\s?=(\S+)[\s|,]/
结果:
array(3) {
[0] =>
array(3) {
[0] =>
string(28) "left=123,top=345,width=123, "
[1] =>
string(12) "center=yes, "
[2] =>
string(23) "help=no,resizable=yes, "
}
[1] =>
array(3) {
[0] =>
string(4) "left"
[1] =>
string(6) "center"
[2] =>
string(4) "help"
}
[2] =>
array(3) {
[0] =>
string(22) "123,top=345,width=123,"
[1] =>
string(4) "yes,"
[2] =>
string(17) "no,resizable=yes,"
}
}