本帖最后由 llsheng_73 于 2015-12-11 11:45 编辑
这个用正则好象最好搞,只是我不会正则
 - (defun tt(a / b c d e)
- (setq b(vl-string->list a))
- (while b
- (setq a(car b)b(cdr b)c(car b)d(if(or(= a 46)(< 47 a 58))(list a)))
- (while(or(and(< -1 a 46)(< -1 c 46))
- (or(= a 46)(= c 46))
- (and(< 47 a 58)(< 47 c 58))
- (and(> a 57)(> c 57))
- (and(> a 128)(> c 128))
- (and(> a 128)(< c 129)(/=(length d)(*(/(length d)2)2))))
- (setq a(car b)b(cdr b)c(car b)
- d(if(or(< 47 a 58)(and(= a 46)(not(member 46 d))))(cons a d)d)))
- (setq e(if d(cons(reverse d)e)e)))
- (mapcar'VL-LIST->STRING(reverse e))
- )
_$ (tt"12.21ABC73.9·2.....0A")
("12.21" "73.9" "2.0")
_$ (tt"12.21ABC73.9·20A")
("12.21" "73.9" "20")
|