search

Home  >  Q&A  >  body text

javascript - What does js regular match match?

/^[\s\u3000]*|[\s\u3000]*$/
欧阳克欧阳克2871 days ago614

reply all(3)I'll reply

  • typecho

    typecho2017-06-12 09:27:22

    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

    reply
    0
  • 大家讲道理

    大家讲道理2017-06-12 09:27:22

    Match Chinese and English spaces at the beginning or end of the line

    reply
    0
  • 大家讲道理

    大家讲道理2017-06-12 09:27:22

    Match half-width and full-width spaces before and after a string

    reply
    0
  • Cancelreply