Sublime Forum

Back reference in regex search

#1

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.

([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.

0 Likes

#2

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?

0 Likes

#3

It crashes for me

0 Likes

#4

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.

0 Likes

#5

I tried with a non-empty saved file, and it crashes when searching for code\s\1[/code] but not for code\s[/code]
I’m using build 20090612

0 Likes

#6

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.

0 Likes

#7

[quote=“jps”]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.[/quote]

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

test text…

[quote]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[/quote]

0 Likes

#8

Thanks for the help in tracking this down - the crash will be fixed in the next version too.

0 Likes