Quantcast
Channel: SeoTools for Excel - Community - Latest topics
Viewing all articles
Browse latest Browse all 1126

Correct usage of RegExpReplace

$
0
0

@chilly_bang wrote:

I scrape google's search results number with the line:

=RegexpReplace(Dump(XPathOnUrl("https://www.google.de/search?q=test&num=10&hl=en&safe=off&source=lnt&tbs=cdr:1,cd_min:1/1/2016,cd_max:2/1/2016";"//*[@id=""resultStats""]";;HttpSettings(WAHR);"text"));"\d*\.\d*";"$1")

I need RegexpReplace because the GoogleSearch function is buggy, i need special dates in a query, and the scraped result is a string like "About 13.600 results", where i'm needing only the number. So i try to filter words out with RegexpReplace.... and fail. This regex \d*\.\d* finds correctly the number, but RegexpReplace makes from it instead the number About $1 results (0,33 seconds). You see - it doesn't replace the whole match with the found string, but replaces found string with $1. Why? How can i achieve the correct replacement?

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 1126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>