xxxxxxx xxxxxx xxx x x xxxxxx xx x x x...">

JavaScript Regular Expression - strange results

I have a sample string below: var nodeTest = "xxxxxxx xxxxxx xxx x x xxxxxx xx x x xxxxxxxxxx xxxxx"; I am trying to match all nodes with and without white spaces so anything (numbers, white space, text and all characters - think everything!) between <> including <>. I have tried many configurations but they don't seem to work intuitively, my most recent bit of logic being this: var nodePairs = nodeTest.match(/<(.*)>/gi); But it matches the ENTIRE test string. Can anyone offer any clues as to where I might be going wrong? Thanks!
I am not sure what your main intentions are but in case you have difficulty with really complex xmls/htmls then I would recommend that you use jquery to parse them example - $("xxxxxxx xxxxxx xxx x x xxxxxx xx x x xxxxxxxxxx xxxxx")

以上就是JavaScript Regular Expression - strange results的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准