search and replace bug/feature

Bugs will be moved here once resolved.

Post » Fri Sep 02, 2011 7:05 pm

In short search and replace uses regular expressions for the search string. Feature? Which is cool except when searching for special characters like '?'.

find("123?", "?") causes the preview to be grey, because "?" is not a valid regular expression. It is fixed by using "\?" instead:
find("123?", "\?")

I think that search and replace should be just simple searches and replaces, which is what's expected when using them.

This site:
http://80.68.89.23/2006/Jan/20/escape/
has a solution to escape all the special characters.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Fri Sep 02, 2011 7:50 pm

Thanks, good catch. I left it in thinking it would be a useful feature, but I suppose it shouldn't be exposed through these expressions, a separate regexp feature would probably be more useful. Fixed for next build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests