John Boe
John Boe

Reputation: 3611

invalid regexp group

I have regular expression

(?<=\s)(?:#sidebar-right-1|#BlogArchive1|#ArchiveList|#BlogArchive1_ArchiveList|#PopularPosts)(?=\s|{)

I got syntax error invalid regex group. Where is problem?

I applied it like this:

rules[r].selectorText.match(new RegExp(ids, 'gm'))

Upvotes: 1

Views: 2223

Answers (1)

redneb
redneb

Reputation: 23850

It appears that javascript's regexs do not support positive lookbehind assertions (i.e. the (?<=\s) part).

Upvotes: 5

Related Questions