regex issue with numbers (python) -
i have string thath goes that:
<123, 321>
the range of numbers can between 0
999
.
i need insert coordinates fast possible 2 variables, thought regex. i've splitted string 2 parts , need isolate integer other characters. i've tried pattern:
^-?[0-9]+$
but output is:
[]
any help? :)
if strings follow same format <123, 321>
should little bit faster regex approach
def str_translate(s): return s.translate(none, " <>").split(',') in [52]: str_translate("<123, 321>") out[52]: ['123', '321']
Comments
Post a Comment