search

Home  >  Q&A  >  body text

javascript - js regular match specific string

How to use js regular expression to match a text that contains   without ";" after it? ;I want to replace all " " in a paragraph with  ";"

扔个三星炸死你扔个三星炸死你2697 days ago899

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-07-05 11:07:43

    Is this so?

    " sdadsad&nbsp呵呵呵".replace(/(&nbsp)(?!;)/g,';')

    Reference: http://www.cnblogs.com/deerch...

    reply
    0
  • 世界只因有你

    世界只因有你2017-07-05 11:07:43

    "&nbsp &nbsp+;sdadsad&nbsp呵呵呵".replace(/(&nbsp)(?!;)/g,';')

    reply
    0
  • Cancelreply