最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

regex - Convert PHP preg_match to javascript - Stack Overflow

programmeradmin2浏览0评论

can somebody help me converting this

preg_match('/^(.*?)[#,\.0]+(.*?)$/',$patterns[0],$matches)

into Javascript equivalent? I tried doing

matches = patterns[0].match('/^(.*?)[#,\.0]+(.*?)$/')

but this results in null...

can somebody help me converting this

preg_match('/^(.*?)[#,\.0]+(.*?)$/',$patterns[0],$matches)

into Javascript equivalent? I tried doing

matches = patterns[0].match('/^(.*?)[#,\.0]+(.*?)$/')

but this results in null...

Share Improve this question asked Jun 8, 2012 at 11:38 ragulkaragulka 4,3527 gold badges49 silver badges74 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Remove the quotes from the regex

matches = patterns[0].match(/^(.*?)[#,\.0]+(.*?)$/);
发布评论

评论列表(0)

  1. 暂无评论