Question: I want to catch word with non-space.

```
var paragraphy="Apple banana kişiler ki örnek foo.";
var word="kişiler"; 
var regex = new RegExp("(?:[\\s>]|^)("+word+")(?=[.,;?!]?(?:[<\\s])|$)", "gi");
console.log(paragraphy.match);

```

This prints: [" kişiler"] but I want this result: ["kişiler"]
I must use Positive Lookbehind but it is not supported in JavaScript. Is there an alternative solution?

Answer: 
Because you need to load your scrollto script at the end of the body tag, to make sure DOM is loaded. Otherwise you can wrap your code in 

```
$(document).ready(function(){
   //your code here
});

```

or use the sort version 

```
$(function() {
    //your code here
});

```
You can try this:

```
$('body').on('click', 'a[href^="#"]', function (event) {
  var target = $(this.href);
  if( target.length ) {
    event.preventDefault();
    $('html, body').animate({
        scrollTop: target.offset().top
    }, 10000);
  }
});

```

You can replace body with any parent selector which are loaded in DOM.