Error: JavaScript does not support regular expressions that can match 0 characters

Web Scraper version: 0.3.8.2
Chrome version: Version 69.0.3497.100 (Official Build) (64-bit)
OS: Win 10 64 bit

Sitemap: n/a

Error Message:

JavaScript does not support regular expressions that can match 0 characters.

My question is, is this error unwarranted? I'm trying to enter the regex:
^(?!.*null).*$

Someone has already reported this problem before but the link to the bug report page is dead, for whatever reason. However, the Google search result snippet reads:

web-scraper-chrome-extension by martinsbalodis - RecordNotFound

https://recordnotfound.com/web-scraper-chrome-extension-martinsbalodis-22779
Mar 15, 2018 - ... not found; over 2 years Regex checker incorrectly states "JavaScript does not support regular expressions that can match 0 characters.

Your regex expression can return 0 characters. Replace * with + after negative lookahead.

Here is the correct regex: ^(?!.*null).+$

1 Like

What if this is intentional?

I want this:
^(?!null$).*

such that

a user entering "null" will be capture as ""

.* is not allowed because there was a problem with legacy Chrome version regex implementation.

1 Like

So there is no solution/workaround you can think of to my problem?

^(?!null$).+ will work the same.

1 Like

When I tried using in the Webscraper plugin to extract text, using ^(?!null$).+, it still extracts "null", where "null" appears. I want to extract nothing ("") where element contains the exact text "null" and nothing else.

Try using CSS selector then - your_selector:not(:contains("null"))

1 Like

Perhaps there has been a misunderstanding or misdiagnosis of the problem on my part.

Is there any chance your plugin is returning "null" as a value when the element targeted by the text selector is not present? I think the website simply doesn't generate the element when its contents are empty, for some products.

If so, how can I turn this plugin behaviour off, so that "" is returned as a value instead of "null", in such cases when the targeted element is not present?