Home Download Buy Blog Forum Support

back reference in regex search

back reference in regex search

Postby vincent on Sat Jun 13, 2009 2:53 am

I like the regexp highlighting features in sublime, but recently when I tried expressions that had back reference in them, the os just reported problems and sublime quit. I am using windows vista. Here is the regexp I used when problem encountered.

Code: Select all
([a-z]+)\s\1


Does sublime's regex engine support back reference? Can anyone familar with this tell me which metacharacters are supported by sublime? Thanks.
vincent
 
Posts: 3
Joined: Sat Jun 28, 2008 4:24 am

Re: back reference in regex search

Postby jps on Sat Jun 13, 2009 11:54 am

I tried to replicate the crash, but was unable to - the regex worked fine for me. Does it crash for you if you try again on the same file?
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: back reference in regex search

Postby gpfsmurf on Mon Jun 15, 2009 6:25 pm

It crashes for me
gpfsmurf
 
Posts: 211
Joined: Mon Jun 23, 2008 6:31 pm

Re: back reference in regex search

Postby jps on Mon Jun 15, 2009 10:35 pm

I can get it to crash only on an empty buffer, which turn out to be a more general bug: find always crashes on an empty buffer (current beta only I think, I suspect 1.05 doesn't). This will be fixed in the next version.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: back reference in regex search

Postby gpfsmurf on Tue Jun 16, 2009 4:56 pm

I tried with a non-empty saved file, and it crashes when searching for
Code: Select all
([a-z]+)\s\1
but not for
Code: Select all
([a-z]+)\s

I'm using build 20090612
gpfsmurf
 
Posts: 211
Joined: Mon Jun 23, 2008 6:31 pm

Re: back reference in regex search

Postby jps on Wed Jun 17, 2009 1:31 pm

Putting aside any crashing issues, the regex isn't working as desired in the current version of sublime: back references have been inadventantly disabled in the current build. This will be fixed in the next version.

I'm unable to get any crashes though (other than with an empty buffer), so if someone has a file that reliable triggers it, I'm keen to be sent a copy.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: back reference in regex search

Postby EJ12N on Wed Jun 17, 2009 3:23 pm

jps wrote:Putting aside any crashing issues, the regex isn't working as desired in the current version of sublime: back references have been inadventantly disabled in the current build. This will be fixed in the next version.

I'm unable to get any crashes though (other than with an empty buffer), so if someone has a file that reliable triggers it, I'm keen to be sent a copy.


It crashes for me too...
http://ej12n.com/screencasts/regexcrash.htm

test text...
Charles City
Colonial Heights City
Essex
Gloucester
James City
King and Queen
King William
Lancaster
Mathews
Middlesex
New Kent
Northumberland
Richmond
Westmoreland
Williamsburg City
York
EJ12N
 
Posts: 281
Joined: Tue Apr 21, 2009 5:23 pm

Re: back reference in regex search

Postby jps on Fri Jun 19, 2009 3:31 am

Thanks for the help in tracking this down - the crash will be fixed in the next version too.
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], skyhook, Yahoo [Bot] and 29 guests