JavaScript (Node.js), 43 bytes
x=>~(g=s=>~s.indexOf(x,1)||g(s+i++))(x,i=1)
Using range, fail 11 (expect 13, get 1)
JavaScript (Node.js) , 49 bytes
x=>~(g=s=>~s.search(x)||g(s+ ++i))(i='')+x.length
-4 from Arnauld
Not using the 10
JavaScript (Node.js), 49 bytes
x=>~(g=s=>~s.search(x)||g(s+ ++i))(i='')+x.length
-4 from Arnauld
Not using the 10
JavaScript (Node.js), 43 bytes
x=>~(g=s=>~s.indexOf(x,1)||g(s+i++))(x,i=1)
Using range, fail 11 (expect 13, get 1)
JavaScript (Node.js) , 49 bytes
x=>~(g=s=>~s.search(x)||g(s+ ++i))(i='')+x.length
-4 from Arnauld
Not using the 10
JavaScript (Node.js), 5749 bytes
x=>(g=s=>x=>~(k=sg=s=>~s.matchsearch(x))?k.index+x.length:g||g(s+ ++i))(i='')+x.length
-4 from Arnauld
Not using the 10
JavaScript (Node.js), 57 bytes
x=>(g=s=>(k=s.match(x))?k.index+x.length:g(s+ ++i))(i='')
Not using the 10
JavaScript (Node.js), 49 bytes
x=>~(g=s=>~s.search(x)||g(s+ ++i))(i='')+x.length
-4 from Arnauld
Not using the 10
JavaScript (Node.js), 57 bytes
x=>(g=s=>(k=s.match(x))?k.index+x.length:g(s+ ++i))(i='')
Not using the 10