/^[\s\u3000]*|[\s\u3000]*$/
温故而知新,可以为师矣。 博客:www.ouyangke.com
s means English space, u3000 means Chinese space ^[su3000]* matches the beginning of a space, [su3000]*$ matches if there is a space at the end, Wu Ke is right
s
u3000
^[su3000]*
[su3000]*$
Match Chinese and English spaces at the beginning or end of the line
Match half-width and full-width spaces before and after a string
s
means English space,u3000
means Chinese space^[su3000]*
matches the beginning of a space,[su3000]*$
matches if there is a space at the end, Wu Ke is rightMatch Chinese and English spaces at the beginning or end of the line
Match half-width and full-width spaces before and after a string