Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

gjtorikian opened this issue Apr 2, 2012 · 1 comment

Comments

@gjtorikian
Copy link
Contributor

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
Copy link
Member

merging into #2059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants