Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Jul 05, 2010 5:36 am   

[3.22]BUG?: Find/Replace Regex syntax not working
 
I could be wrong about this, and I've never seen it come up until I decided to help someone else who would need to use this feature.

Apparently, if you do:

Find: (\w+)

it will not find it (the parentheses break it). This is a bit heartbreaking because it takes out the possibility of doing something like:

Find: #VAR @(\w+)
Replace: #VAR @{\1}

like many external editors can do. Was this intended? Is this a bug? Was it overlooked? Can it be added? Thanks!

Charneus
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Jul 05, 2010 8:51 am   
 
Hmm, the behavior is confirmed. Zugg will have to determine if it's a bug because this will do what you want.

Find: #VAR @\(\w+\)
Replace: #VAR @{\1}
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jul 06, 2010 5:13 pm   
 
Nothing I can do about this one, sorry. That's the find/replace regex code within the Scintilla editor library. It isn't code that I can access (it's in the DLL). But remember that () in a regular expression are normally reserved for saving subpatterns so Tech is correct that if you want to match () characters verbatim then you need to escape them with the \ character just like in any other regular expression.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Jul 06, 2010 5:42 pm   
 
Zugg I don't think he was trying to match the verbatim character. It's seems that to match the sub-pattern you need to escape the parentheses. This is more or less sorted though.
_________________
Asati di tempari!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net