I get completely different results from string.scan and several regex testers ...
I'm just trying to grab a domain from a string, this is the last word.
Corresponding regex:
/([a-zA-Z0-9\-]*\.)*\w{1,4}$/
String (1 single string checked in runty runtime btw)
str = 'Show more results from software.informer.com'
Work fine, but in ruby ....
irb(main):050:0> str.scan /([a-zA-Z0-9\-]*\.)*\w{1,4}$/
=> [["informer."]]
I would think that I would get a match on software.informer.com, which is my goal.
source
share