Hi. As somewhat a follower of ProsNpad & its RegEx Find and Replace functionality, I noticed in recent changelog reports that the RegEx has been updated. I thought it might be of help to report my experience while using Replace with regular expressions attempting to dissect some of what's going on in the YUI(1) JavaScript library component, yahoo-dom-event.js
Most of the time, everything works great (e.g. i often turn to ProsNpad for regular expression operations. for curiosity, i've done some amount of testing for differences between PN, other Scintilla-based editors, .NET-based editors, etc.), and I've been successful with it in some instances where i experienced difficulty with other editors (i.e. it's amazing the variance between different "flavors", as implemented in editors [to quote the Regex Buddy author's texts])
One of the several expressions I've used, is shown below-- it's one of a few which caused the unexpected result:
Match Expression:
(return[ \S]+;)(})(?=\S)
Replace Expression:
\n\1\n\2\n\3
The unexpected result follows:
Before:
if(this.__yui_events){
if(this.__yui_events[A]){
return true;}}
return false;}};(function(){
After:
if(this.__yui_events){
if(this.__yui_events[A]){
return true;
}
\\}
return false;}};(function(){
Programmer's Notepad had previously executed a Replacement Expression successfully on 650+ items in that same file, just as i wanted without error. However, when I first opened the file, i was seeing this error. I enabled (tested), then disabled the "Allow Backslash Expression" option at that time, which seemed to "fix" the error, but that old-trick didn't work this time. ;-)
Looking through the code, it must have "went away" for the bulk of my work, i think until trying this particular expression which, btw-- i realized, even if successful, wasn't quite what i was going for-- but, you know-- win some lose some, eh? (a lot of fooling around w/ regex, really-- guess i enjoy wasting time... i dunno) heheh... anyway--
I suspect, if i exit the app, and restart it-- i'll probably have more success-- so, this isn't a complaint, but just an FYI.
best regards!
-js
EDIT: geez... i hope i edited that code correctly, to reflect what's going on. note the double-reverse-solidus character which appeared (the unexpected result) in the "After" shot. NOTE: -- here, it doesn't appear as PNpad has removed any chars, which was the plan, however-- as i mentioned, when i first started, and i saw these reverse-solidus chars, it was removing, for example, instead of returning \1, it removed it, and went on w/ the rest of the expression. damn-- too bad it's so difficult to try to explain in a few short sentences, and many long sentences doesn't help much, i guess. oh well! 'least i've tried, eh? :-)
(1)
sourceforge . net / projects / yui /