r1chardj0n3s / parse

Parse strings using a specification based on the Python format() syntax.
http://pypi.python.org/pypi/parse
MIT License
1.72k stars 101 forks source link

seach cut the result with {:^} #112

Closed diegomcas closed 4 years ago

diegomcas commented 4 years ago

from parse impor * str = ' 12 , 34 '

Incorrect with search

print(search('{:^},{:^}', a)) <Result ('12', '3') {}>

Correct with parse

print(parse('{:^},{:^}', a)) <Result ('12', '34') {}>

r1chardj0n3s commented 4 years ago

Thanks, I've altered the code to have it attempt to match more of the trailing centered content.