search

Home  >  Q&A  >  body text

javascript - js regular matching problem

I would like to ask you where I made a mistake. Why is there no "[b]php5[/b]" and "[b]php4[/b]" that I want?

漂亮男人漂亮男人2741 days ago775

reply all(2)I'll reply

  • 某草草

    某草草2017-05-31 10:44:07

    /(\[[a-z]\])(\w*)(\[\/[a-z]\])/g

    Thank you everyone, I wrote it down

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-31 10:44:07

    /([[w]])(w*)([/[w]])/g Just finished writing, str.replace(re,function(str,$1,$2,$3){ return str;}) like this Write clearly

    reply
    0
  • Cancelreply