"find" with RegExp is unfaithful with "^" char #692

Closed
gjtorikian opened this Issue Apr 2, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@gjtorikian
Contributor

gjtorikian commented Apr 2, 2012

Consider this small test file:

console.log('test: <test>')
var b = "hi";
console.log(b);

A search for ^\w+ finds TWO results: var and b.

I've isolated the problem to this line of code: https://github.com/ajaxorg/ace/blob/master/lib/ace/search.js#L140

It seems that the startIndex--in this case, anyway--is 4, which chops the var string off, which makes the match think that b is the beginning of a line.

@nightwing

This comment has been minimized.

Show comment
Hide comment
@nightwing

nightwing Jul 22, 2014

Member

merging into #2059

Member

nightwing commented Jul 22, 2014

merging into #2059

@nightwing nightwing closed this Jul 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment