<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>pnotepad.org forums &#187; Tag: regex - Recent Posts</title>
		<link>http://pnotepad.org/forums/tags/regex</link>
		<description>Programmer&#039;s Notepad Forums</description>
		<language>en-US</language>
		<pubDate>Thu, 09 Feb 2012 07:11:16 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.3</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://pnotepad.org/forums/search.php</link>
		</textInput>
		<atom:link href="http://pnotepad.org/forums/rss/tags/regex" rel="self" type="application/rss+xml" />

		<item>
                        <title>RegEx in PN  - Example (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/7416#post-10570</link>
			<pubDate>Thu, 12 Jan 2012 15:30:06 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">10570@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Well I think that the dot operator should be [^\r\n] because as the defect points out the current behavior is not consistent. However I love that PN does actually support multi-line regex - i.e. that [\s\S] WILL match across new-line chars. Though I suppose that it would be nice to have a &#34;single-line/muti-line&#34; option that would either look at the document on a line-by-line basis or (as it is currently) as a single stream.&#60;/p&#62;
&#60;p&#62;Since this is one area of PN that I use extensively I too will be looking into improving PN's regex support. For my personal use I have already added the &#60;a href=&#34;http://code.google.com/p/pnotepad/issues/detail?id=1534&#38;amp;q=regex&#38;amp;sort=-id&#34;&#62;format_perl&#60;/a&#62; features from Xpressive.&#60;/p&#62;
&#60;p&#62;I also spectacularly failed in my attempt to add Unicode support for replace! However, I am still looking into how you managed to get unicode search working and I am confident that I can sort things out. My fail-safe plan is to parse the replace string and &#34;encode&#34; the unicode chars into \x00\x00 etc. so that the replace string can remain a std::string. However, I know next to nothing about the non-ASCII world so I don't know how successful I will be. I will probably pester you with questions. :)
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx in PN  - Example (simon)</title>
			<link>http://pnotepad.org/forums/topic/7416#post-10567</link>
			<pubDate>Thu, 12 Jan 2012 10:20:39 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">10567@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Excellent stuff! This would be great content for the docs or blog - perhaps both. &#60;/p&#62;
&#60;p&#62;It's definitely worth looking into Xpressive's newline matching behaviour. I agree that generally we don't want to match newlines, although for some multi-line matching it can be useful.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx in PN  - Example (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/7416#post-10563</link>
			<pubDate>Wed, 11 Jan 2012 23:37:56 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">10563@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;As long as we are on the topic of RegEx: &#60;a href=&#34;http://code.google.com/p/pnotepad/issues/detail?id=1533&#38;amp;sort=-id&#34;&#62;There is a defect logged about the nature of the dot (.) operator.&#60;/a&#62; As I understand it the dot operator should not match to EOL chars. The XPressive search is given the option regex_constants::not_dot_newline which keeps the dot from matching to \n. However windows tends to use \r\n as a newline marker and the dot will match to \r.&#60;/p&#62;
&#60;p&#62;So when it comes to the end of the line, the dot operator can be a little funny. So often it is best just to not use it!&#60;/p&#62;
&#60;p&#62;the dot operator operates as: [^\n] -- matches everything BUT the new line char.&#60;br /&#62;
What windows users typically expect: [^\r\n] -- match everything BUT the windows new line chars&#60;br /&#62;
How to match any char: [\s\S] -- will match any char.&#60;/p&#62;
&#60;p&#62;Example: Say you want to replace the inner most div tags with span tags.&#60;/p&#62;
&#60;p&#62;Find What: &#38;lt;div&#38;gt;(?![\s\S]*?&#38;lt;div&#38;gt;[\s\S]*)([\s\S]*?)&#38;lt;/div&#38;gt;&#60;br /&#62;
Replace with: &#38;lt;span&#38;gt;\1&#38;lt;/span&#38;gt;&#60;/p&#62;
&#60;p&#62;The basic version of this regex is: &#38;lt;div&#38;gt;([\s\S]*?)&#38;lt;/div&#38;gt;&#60;/p&#62;
&#60;p&#62;this captures all chars inside of a div tag-- however if the tags are nested then problems happen since this will match the first open div tag with the first close div tag. So we add an assertion that the match does not include a div tag itself. The result is that we will look for the inner most div tag (assuming of course valid HTML).&#60;/p&#62;
&#60;p&#62;The point of the example is that we can use [\s\S] to capture all chars in the tags (including new line chars). \s is the class of all white-space characters and \S is the set of all NON-white-space characters. One could equally use [\w\W] or [\d\D] &#60;/p&#62;
&#60;p&#62;Sometimes however it is nice to be able to limit our searches to a single line. Using [\s\S] can get us into trouble here since even something like: //([\s\S]*)$ &#60;/p&#62;
&#60;p&#62;an attempt to grab the content of an end-of-line comment - but this will match past the end of lines. We would need: //([\s\S]*?)$  to ensure the non-greedy match.&#60;/p&#62;
&#60;p&#62;Or we could just be more specific on what we were looking for: //([^\r\n]*)&#60;/p&#62;
&#60;p&#62;So it is true that the dot operator is a little buggy in PN (when operating of files using \r\n or \r line endings) but a little knowledge can get you around and let you use the full power of PN's regular expression search and replace.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx in PN  - Example (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/7416#post-10562</link>
			<pubDate>Wed, 11 Jan 2012 15:05:11 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">10562@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;So how might this be useful? Well people often use TODO: tags in comments to identify tasks that need to be completed. The following PyPn script will extract all TODO: EOL comments (on their own line) into a new file.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;###############################################################################
## Extract all ToDo lines into a new file
## By: NickDMax

import pn
import scintilla
from pypn.decorators import script

@script(&#38;quot;Extract Todo&#38;quot;,&#38;quot;CPP Utils&#38;quot;)
def Name():
    &#38;quot;&#38;quot;&#38;quot; Extract TODO: lines into a new file &#38;quot;&#38;quot;&#38;quot;
    #recorded search/replace wrapped in an UndoAction
    doc = pn.CurrentDoc()
    sci = scintilla.Scintilla(doc)
    sci.BeginUndoAction()
    opt = pn.GetUserSearchOptions()
    opt.FindText = u&#38;#039;^(?:(?![ \\t]*//[ \\t]*(?i:TODO:)).*(?:\\r\\n)+&#124;[ \\t]*//[ \\t]*(?i:TODO:)[ \\t]*(.*)(\\r\\n)?(?:\\r\\n)*)&#38;#039;
    opt.MatchWholeWord = False
    opt.MatchCase = False
    opt.UseRegExp = True
    opt.SearchBackwards = False
    opt.LoopOK = True
    opt.UseSlashes = False
    opt.ReplaceText = u&#38;#039;\\1\\2&#38;#039;
    opt.ReplaceInSelection = False
    doc.ReplaceAll(opt)
    sci.EndUndoAction()
    #Now to save the text in a new file
    startPos = 0
    endPos = sci.Length
    text = sci.GetTextRange(startPos, endPos)
    newDoc = pn.NewDocument(&#38;quot;&#38;quot;)
    newsci = scintilla.Scintilla(newDoc)
    newsci.BeginUndoAction()
    newsci.AppendText(len(text), text)
    newsci.EndUndoAction()
    #restore the document
    sci.Undo();&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Of course I have only tested this with one test file:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#include&#38;lt;iostream&#38;gt;

//TODO: remember to do something here.

int main() {
    //TODO: remember to do something else here
    //  TODO:  oh don&#38;#039;t forget to do this

    return 0;
}

//  ToDo:   and then there is this here too.&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;So a little more testing is probably needed to ensure that it is working as expected.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx in PN  - Example (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/7416#post-10559</link>
			<pubDate>Wed, 11 Jan 2012 02:51:44 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">10559@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;So I was thinking about this &#60;a href=&#34;http://untidy.net/blog/2011/05/18/regular-expressions-and-scripts-worked-example/&#34;&#62;RegEx/Script example from the Untidy blog&#60;/a&#62; and I thought: &#34;Can that be one in 1 RegEx?&#34;&#60;/p&#62;
&#60;p&#62;The answer is of course: Yes - but would you really want to.&#60;/p&#62;
&#60;p&#62;Search: ^(?:(?!LogStep).*(?:\r\n)+)&#124;(?:LogStep\(\s*&#34;([^&#34;]+)&#34;\s*\).*(\r\n)(\r\n)*)&#60;br /&#62;
Replace: \1\2&#60;/p&#62;
&#60;p&#62;hit &#38;lt;Replace All&#38;gt;&#60;/p&#62;
&#60;p&#62;This is a pretty complex RegEx so lets break it up. The overall structure is A&#124;B&#60;/p&#62;
&#60;p&#62;A: RegEx to match the rest of a line NOT BEGINNING with &#34;LogStep&#34;&#60;br /&#62;
B: RegEx to match the rest of a line that DOES begin with &#34;LogStep&#34; - capture the text (and a CRLF new line)&#60;/p&#62;
&#60;p&#62;The whole thing is wrapped in a the expression: ^(?:A&#124;B)&#60;/p&#62;
&#60;p&#62;where ^ asserts the beginning of a line, and (?: ) is a non-capture group - that is it treated as a group but not captured into \1 or \2 etc. - this outer non-capture group creates separation. Without it our expression would need to be: ^A&#124;^B&#60;/p&#62;
&#60;p&#62;Since the expression A contains no capture groups BUT the overall expression DOES contain capture 2 capture groups \1 and \2 will be empty when expression A matches. When B matches \1 is the text inside of the quotation marks, and \2 is a crlf (\r\n) pair.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx Questions (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/702#post-2559</link>
			<pubDate>Wed, 04 Nov 2009 08:12:33 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">2559@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Well for example today I needed to create a bunch of constants in some code. I generally like my constants to have all capital names. So I used a regex like this to get build the constants from an exported excel table:&#60;br /&#62;
Search: ^(\w+).*$&#60;br /&#62;
Replace: Public Const \1 as String = &#34;\1&#34;&#60;/p&#62;
&#60;p&#62;Then I had to go an highlight each identifier and hit ctrl-shift-U to make it upper case.&#60;/p&#62;
&#60;p&#62;It would have been nice to be able to have the replace string as something like:&#60;br /&#62;
Public Const $(u\1) as String = &#34;\1&#34;&#60;/p&#62;
&#60;p&#62;I *think* that xpressive may actually support \U \L formatting expression using the format_perl formatted -- but none of my attempts to get this to work have been successful and I can't find an example. &#60;/p&#62;
&#60;p&#62;If it is not feasible to add a little more functionality to the replacement format -- then allowing PyPN to get search results as an object would allow a PyPN script to preform the actual replacement function. Right now one would have to use the Python RegEx -- and I suppose there is nothing really wrong with that approach.&#60;/p&#62;
&#60;p&#62;BTW: The Boost bug report has been resolved so in boost 41 the error should be removed -- you were right those guys are on top of things.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx Questions (simon)</title>
			<link>http://pnotepad.org/forums/topic/702#post-2556</link>
			<pubDate>Tue, 03 Nov 2009 15:22:57 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">2556@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Ah nice, I hadn't come across quoted sequences before - useful, shame about the bug!&#60;/p&#62;
&#60;p&#62;Named groups would be nice to support for search and replace, they're used all over PN for the tool output parsing and the like.&#60;/p&#62;
&#60;p&#62;Could you explain the plugin formatting further? I'm guessing you want some way to hand off the formatting of expressions in the replace box to a plugin? A scenario example would make this more clear.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx Questions (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/702#post-2555</link>
			<pubDate>Tue, 03 Nov 2009 15:22:21 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">2555@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I created a Boost ticket #3586 for this.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx Questions (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/702#post-2554</link>
			<pubDate>Tue, 03 Nov 2009 14:55:49 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">2554@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Just a note: Don't try to use the regex: &#34;\Q.*\E&#34; -- this locks up. In fact from my tests I would say don't use a */+ inside a quoted sequence. The following works &#34;\Q([.])\E&#34; -- and will find any occurrences of &#34;([.])&#34; without having to use the regex &#34;\(\[\.\]\)&#34;. This only seems to affect usage of */+ inside of the quoted sequence.&#60;/p&#62;
&#60;p&#62;To test to ensure it was not a PN problem I used the following which locks up:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#include &#38;lt;iostream&#38;gt;
#include &#38;lt;boost/xpressive/xpressive.hpp&#38;gt;

using namespace boost::xpressive;

int main()
{
    std::string hello( &#38;quot;hello .* world!&#38;quot; );

    std::cout &#38;lt;&#38;lt; &#38;quot;compile regex&#38;quot; &#38;lt;&#38;lt; std::endl;
    sregex rex = sregex::compile( &#38;quot;\\Q.*\\E&#38;quot; );
    smatch what;

    std::cout &#38;lt;&#38;lt; &#38;quot;Get Iterator&#38;quot; &#38;lt;&#38;lt; std::endl;
    sregex_iterator cur( hello.begin(), hello.end(), rex );
    sregex_iterator end;

    std::cout &#38;lt;&#38;lt; &#38;quot;begin search&#38;quot; &#38;lt;&#38;lt; std::endl;
    while( cur != end ) {
        smatch const &#38;amp;what = *cur;
        std::cout &#38;lt;&#38;lt; &#38;quot;found: &#38;quot; &#38;lt;&#38;lt; what[0] &#38;lt;&#38;lt; &#38;#39;\n&#38;#39;;
        cur++;
    }

    return 0;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This locks up at the compile stage which explains why PN locks up given that regex. &#60;/p&#62;
&#60;p&#62;Hopefully we can get Xpressive to address this because oddly enough, searching for a regular expression inside of code is something that may come up within a Programmer's Notepad.&#60;/p&#62;
&#60;p&#62;However Simon I would like to say that the addition of XPressive is outstanding! It would be great if we could use some of the features like named groups and perhaps plug-in formatting (esp. PyPN scripts if that would be possible). &#60;/p&#62;
&#60;p&#62;I will try to update the wiki throughout this week (I think the bulk is already done).
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx Questions (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/702#post-2551</link>
			<pubDate>Mon, 02 Nov 2009 17:13:31 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">2551@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I had read in your blog that you were looking into XPressive so this is what I thought that you were using. I will try it out in XPressive and let you know what I find. I do happen to be C++ friendly, and roughly familiar with Boost::XPressive. This information should also help me in bettering the wiki documentation.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx Questions (simon)</title>
			<link>http://pnotepad.org/forums/topic/702#post-2545</link>
			<pubDate>Sat, 31 Oct 2009 17:32:28 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">2545@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi Nick,&#60;/p&#62;
&#60;p&#62;We're using Boost:XPressive for the library, and they've been very responsive with bugs in the past. It's worth trying with just that library (if you're C++ friendly) to check it's an XPressive bug rather than a PN bug.&#60;/p&#62;
&#60;p&#62;Simon.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>RegEx Questions (NickDMax)</title>
			<link>http://pnotepad.org/forums/topic/702#post-2540</link>
			<pubDate>Fri, 30 Oct 2009 17:13:32 +0000</pubDate>
			<dc:creator>NickDMax</dc:creator>
			<guid isPermaLink="false">2540@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I was trying to update some of the wiki on Regular Expressions and found some oddities -- Though first a question:&#60;/p&#62;
&#60;p&#62;#1. What is the base for PN's Find/Replace RegEx? Boost::XPressive? Boost::Regex?&#60;/p&#62;
&#60;p&#62;Now The RegEx seems to support Look ahead/behind well enough:&#60;br /&#62;
'(.*)(?=ton)' -- seems to work.&#60;br /&#62;
'(?&#38;lt;=Apple)(.*)' -- seems to work.&#60;/p&#62;
&#60;p&#62;but the (?!...) and (?&#38;lt;!...) non-capture groups really seem to be buggy. They Work in some situations but seem to fall apart when combined with greedy quantifiers. &#60;/p&#62;
&#60;p&#62;'(?&#38;lt;!H)(.*)' will still match 'Hello' and&#60;br /&#62;
'(?&#38;lt;!H)([elo]*)' does not seem to match anything. (For example Bello Xello  etc).&#60;/p&#62;
&#60;p&#62;'(.)(?!e)' works fine&#60;br /&#62;
'(.*)(?!e)' Matches every line... (sort of makes sense since this regex matches to end of line charaters...but even things like '(.*)(?!e$)' fail.&#60;/p&#62;
&#60;p&#62;So I am looking for information on the RegEx library used so that I can get a feel for what should be updated in the Wiki.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Replace w/ Regular Expressions: Unexpected Behaviour (Nux)</title>
			<link>http://pnotepad.org/forums/topic/651#post-2377</link>
			<pubDate>Mon, 31 Aug 2009 13:42:12 +0000</pubDate>
			<dc:creator>Nux</dc:creator>
			<guid isPermaLink="false">2377@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;The expression &#34;(return[ \S]+;)(})(?=\S)­­&#34; is not valid - it should be:&#60;br /&#62;
(return[ \S]+;)(\})(?=\S)­­&#60;br /&#62;
Also note that the third parentheses are non-capturing (so you cannot really use \3). In fact whatever is matched with &#34;(?=\S)­­&#34; wouldn't be in the match at all (i.e. for &#34;return blah;}abc&#34; the match would be &#34;return blah;}&#34; - without &#34;a&#34;).&#60;/p&#62;
&#60;p&#62;Nice regular expression reference is here:&#60;br /&#62;
&#60;a href=&#34;https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/RegExp&#34; rel=&#34;nofollow&#34;&#62;https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/RegExp&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Replace w/ Regular Expressions: Unexpected Behaviour (fedoracore)</title>
			<link>http://pnotepad.org/forums/topic/651#post-2373</link>
			<pubDate>Thu, 27 Aug 2009 23:42:10 +0000</pubDate>
			<dc:creator>fedoracore</dc:creator>
			<guid isPermaLink="false">2373@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;okay. i want to help, so i'll try to open an issue on this soon. coincidentally, i am about to try a regex operation, and i've selected ProsNpad for the job. Perhaps this will lead to something more meaningful in that &#34;issue&#34; entry. otherwise, i'll do my best for creating a proper issue based on what i recall from the previous instance, as stated above.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Replace w/ Regular Expressions: Unexpected Behaviour (simon)</title>
			<link>http://pnotepad.org/forums/topic/651#post-2368</link>
			<pubDate>Tue, 25 Aug 2009 08:39:16 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">2368@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Yes, it looks like there are a couple of bugs with the handling of escaped expressions and grouped expressions with the regular expressions. Could you please open an issue:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://code.google.com/p/pnotepad/issues/entry&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/pnotepad/issues/entry&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Replace w/ Regular Expressions: Unexpected Behaviour (fedoracore)</title>
			<link>http://pnotepad.org/forums/topic/651#post-2360</link>
			<pubDate>Sun, 23 Aug 2009 11:19:04 +0000</pubDate>
			<dc:creator>fedoracore</dc:creator>
			<guid isPermaLink="false">2360@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi. As somewhat a follower of ProsNpad &#38;amp; 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 &#60;em&#62;YUI&#60;/em&#62;(1) JavaScript library component, yahoo-dom-event.js&#60;/p&#62;
&#60;p&#62;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 &#34;flavors&#34;, as implemented in editors [to quote the Regex Buddy author's texts])&#60;/p&#62;
&#60;p&#62;One of the several expressions I've used, is shown below-- it's one of a few which caused the unexpected result:&#60;br /&#62;
Match Expression:&#60;br /&#62;
&#60;code&#62;(return[ \S]+;)(})(?=\S)­­&#60;/code&#62;&#60;br /&#62;
Replace Expression:&#60;br /&#62;
&#60;code&#62;\n\1\n\2\n\3&#60;/code&#62;&#60;br /&#62;
The unexpected result follows:&#60;br /&#62;
&#60;strong&#62;&#60;em&#62;Before&#60;/em&#62;:&#60;/strong&#62;&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if(this.__yui_events){
    if(this.__yui_events[A]){
    return true;}}
    return false;}};(function(){&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;strong&#62;&#60;em&#62;After&#60;/em&#62;:&#60;/strong&#62;&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if(this.__yui_events){
    if(this.__yui_events[A]){

return true;
}
\\}
    return false;}};(function(){&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;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 &#60;em&#62;was&#60;/em&#62; seeing this error. I enabled (tested), then disabled the &#34;Allow Backslash Expression&#34; option at that time, which seemed to &#34;fix&#34; the error, but that old-trick didn't work this time. ;-) &#60;/p&#62;
&#60;p&#62;Looking through the code, it must have &#34;went away&#34; for the bulk of my work, i think until trying this particular expression which, btw-- i realized, even if successful, wasn't &#60;em&#62;quite&#60;/em&#62; 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-- &#60;/p&#62;
&#60;p&#62;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.&#60;/p&#62;
&#60;p&#62;best regards!&#60;br /&#62;
-js&#60;/p&#62;
&#60;p&#62;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 &#34;After&#34; shot. &#60;em&#62;NOTE:&#60;/em&#62; -- 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? :-)&#60;br /&#62;
(1)&#60;br /&#62;
sourceforge . net / projects / yui /
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Search and Replace questions (simon)</title>
			<link>http://pnotepad.org/forums/topic/544#post-1883</link>
			<pubDate>Fri, 27 Feb 2009 19:50:41 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1883@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Thanks, go ahead with google code and I'll take a look.&#60;/p&#62;
&#60;p&#62;For the replace all item you can select from your current position to the end of file and check Replace In Selection.&#60;/p&#62;
&#60;p&#62;There's no way to unmark all at the moment, and there's already a request for changing the mark all color - I know this needs doing :)
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Search and Replace questions (ToddFiske)</title>
			<link>http://pnotepad.org/forums/topic/544#post-1880</link>
			<pubDate>Fri, 27 Feb 2009 17:03:32 +0000</pubDate>
			<dc:creator>ToddFiske</dc:creator>
			<guid isPermaLink="false">1880@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I was using search and replace with regular expressions on some code yesterday and came up with some questions.&#60;/p&#62;
&#60;p&#62;1. The Mark All button highlights all occurrences of the search term to be hightlighted, but this highlighting is barely visible on a dark background theme. Is there a way to change the highlighting color?&#60;/p&#62;
&#60;p&#62;2. Is there a way to unmark all marked items? (As a workaround, I can search for and mark a different sequence.)&#60;/p&#62;
&#60;p&#62;3. When replacing all, is there a way to make it stop at the end of the document, not continue from the top?&#60;/p&#62;
&#60;p&#62;Then I have a feature request related to this:&#60;/p&#62;
&#60;p&#62;If one just did a Replace, I would like F3 to repeat the replace, instead of just repeating the find. Or have a command and keypress that repeats the replace operation. For example, in the Borland Delphi 7 IDE one can start a replace operation and replace one or more occurrences, then close the dialog, move the cursor around, type, etc, then press Ctrl+L to do another replace operation without going back to the dialog. If the last thing was a find operation, then Ctrl+L repeats that instead.&#60;/p&#62;
&#60;p&#62;I will also try to add this request in Google Code.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Java Extension (simon)</title>
			<link>http://pnotepad.org/forums/topic/487#post-1719</link>
			<pubDate>Tue, 18 Nov 2008 10:37:32 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1719@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I'm not personally planning on making a Java extension, but there is no reason why someone else can't - that's why all the extensions interfaces are public and documented. You might look at using SWIG to generate Java interfaces:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.swig.org/Doc1.3/Java.html&#34; rel=&#34;nofollow&#34;&#62;http://www.swig.org/Doc1.3/Java.html&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Java Extension (oh)</title>
			<link>http://pnotepad.org/forums/topic/487#post-1716</link>
			<pubDate>Tue, 18 Nov 2008 10:33:41 +0000</pubDate>
			<dc:creator>oh</dc:creator>
			<guid isPermaLink="false">1716@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Dear PN Team -&#60;/p&#62;
&#60;p&#62;Thank you for a wonderful tool.&#60;/p&#62;
&#60;p&#62;Are there any plans for a Java extension to Programmers Notepad, like PyPN?&#60;/p&#62;
&#60;p&#62;For the moment I use Project Tools and Global Tools to integrate my Java programs into Programmers Notepad (I send the selected text to Java using Standard Input, and I capture the output, replacing the original selection).&#60;/p&#62;
&#60;p&#62;But this method results in frequent crashes of PN.&#60;/p&#62;
&#60;p&#62;I am not very good with Python, and know nothing about C (or what language PN is programmed in). A java extension would mean a way for me to contribute useful scripts (spell checking, regex search &#38;#38; replace in folders, replacement expressions etc.). &#60;/p&#62;
&#60;p&#62;Thanks again for the tool.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Cannot run installer - not administrator (aland)</title>
			<link>http://pnotepad.org/forums/topic/480#post-1700</link>
			<pubDate>Fri, 07 Nov 2008 08:44:45 +0000</pubDate>
			<dc:creator>aland</dc:creator>
			<guid isPermaLink="false">1700@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;thanks simon, the first link worked a charm!
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Cannot run installer - not administrator (simon)</title>
			<link>http://pnotepad.org/forums/topic/480#post-1697</link>
			<pubDate>Thu, 06 Nov 2008 09:08:03 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1697@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;You should download the .zip file version, for support for the regular expression pattern you're using you'll want to use the 2.0.9 testing line which has an entirely new regular expressions engine. The latest release is here:&#60;/p&#62;
&#60;p&#62;2.0.9.872: &#60;a href=&#34;http://pnotepad.googlecode.com/files/pn209872.zip&#34; rel=&#34;nofollow&#34;&#62;http://pnotepad.googlecode.com/files/pn209872.zip&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;If you have trouble with that, the previous release is here:&#60;/p&#62;
&#60;p&#62;2.0.9.853: &#60;a href=&#34;http://pnotepad.googlecode.com/files/pn209853.zip&#34; rel=&#34;nofollow&#34;&#62;http://pnotepad.googlecode.com/files/pn209853.zip&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;There's also a portable zip available which doesn't use the registry or user settings folders for storing configuration.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>Cannot run installer - not administrator (aland)</title>
			<link>http://pnotepad.org/forums/topic/480#post-1695</link>
			<pubDate>Wed, 05 Nov 2008 15:27:00 +0000</pubDate>
			<dc:creator>aland</dc:creator>
			<guid isPermaLink="false">1695@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I already have pn v2.0.6.1 installed on my machine, but since installing it my account has had administrator rights removed (what a pain!). I'd like to upgrade to latest version, but if I run just the installer I get the message &#34;You must be logged in as an administrator when installing this program&#34;.&#60;br /&#62;
Is there a way that I can upgrade to the latest version without the installer?&#60;br /&#62;
The main reason I want to upgrade is because, with this version it doesn't seem possible to use the 'lazy' modifier for regex. eg -&#60;br /&#62;
&#60;code&#62;&#38;lt;.+?&#38;gt;&#60;/code&#62;&#60;br /&#62;
to match HTML/XML tags. I just get 'The specified text cannot be found'.&#60;/p&#62;
&#60;p&#62;Thanks in advance, it's a great program!
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How do I use the new regex? (2.0.9) (simon)</title>
			<link>http://pnotepad.org/forums/topic/439#post-1595</link>
			<pubDate>Thu, 31 Jul 2008 11:03:04 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1595@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;To update the conversation above about multi-line regular expressions, I found a bug in the Boost Xpressive regular expressions library and this has now been fixed so we should get some more sane results. You still can't replace ^$ with a blank line though, and I don't think that's a valid use case for regular expressions. In VIM you have to combine that search with an action to run on each match that deletes the line.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How do I use the new regex? (2.0.9) (simon)</title>
			<link>http://pnotepad.org/forums/topic/439#post-1594</link>
			<pubDate>Thu, 31 Jul 2008 11:01:11 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1594@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Find: &#60;code&#62;\*ORIENTATION ([0-9\.]+)&#60;/code&#62;&#60;br /&#62;
Replace: &#60;code&#62;&#38;lt;Rotations y = &#38;quot;\1&#38;quot; /&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Explanation of &#34;Find&#34;:&#60;/p&#62;
&#60;p&#62;We start with &#60;code&#62;\*&#60;/code&#62; because * is a special regular expressions character and putting the \ in front says that you want the character not the special character.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;ORIENTATION&#60;/code&#62; matches exactly that, and then we come to the bit that captures the number. The parentheses around the expression &#60;code&#62;()&#60;/code&#62; say that you want to use the bit of text that you find later. As it's the first set of parentheses this will be capture group 1. &#60;/p&#62;
&#60;p&#62;The bit inside the parentheses &#60;code&#62;[0-9\.]+&#60;/code&#62; is a character set, including digits 0-9 and the &#60;code&#62;.&#60;/code&#62; character. This is another special character so you need to excape it again (using the \). This matches any one of those characters, and the plus sign afterwards says to include one or more of these characters.&#60;/p&#62;
&#60;p&#62;Explanation of &#34;Replace&#34;: &#60;/p&#62;
&#60;p&#62;Most of the replacement is just text, the only special bit is &#60;code&#62;\1&#60;/code&#62; that gets the text from the group 1 that you stored in the find text.&#60;/p&#62;
&#60;p&#62;Hope that helps!
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How do I use the new regex? (2.0.9) (kwantum)</title>
			<link>http://pnotepad.org/forums/topic/439#post-1593</link>
			<pubDate>Thu, 31 Jul 2008 10:15:51 +0000</pubDate>
			<dc:creator>kwantum</dc:creator>
			<guid isPermaLink="false">1593@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Hi guys&#60;/p&#62;
&#60;p&#62;I'm using version 2.0.9&#60;/p&#62;
&#60;p&#62;Ok, I'm new to this whole search/replace pattern matching stuff. I did read the wiki pages and I now have a pretty good idea of how to use regex. I started with something simple, of course, like the &#34;Fred2XXX&#34; example, but I didn't get the same results: nothing was replaced.&#60;/p&#62;
&#60;p&#62;I'm trying to replace this:&#60;br /&#62;
*ORIENTATION 1.20&#60;/p&#62;
&#60;p&#62;with this:&#60;br /&#62;
&#38;lt;Rotations y = &#34;1.20&#34; /&#38;gt;&#60;/p&#62;
&#60;p&#62;Would somebody mind showing me another example?
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How do I use the new regex? (2.0.9) (simon)</title>
			<link>http://pnotepad.org/forums/topic/439#post-1555</link>
			<pubDate>Thu, 17 Jul 2008 08:19:14 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1555@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;I've just realised that replacing &#60;code&#62;$&#60;/code&#62; with something doesn't do what I expected, it simply inserts after the end-of-line. &#60;/p&#62;
&#60;p&#62;This is because end-of-line matches are zero-width meaning that they simply match the space between the CRLF and the first character on the next line. &#60;/p&#62;
&#60;p&#62;What I'm not sure of is how regular expressions would normally be used to replace empty lines? Replacing &#60;code&#62;^$&#60;/code&#62; just inserts after empty lines - the behaviour in PN is pretty close to what Visual Studio does.&#60;/p&#62;
&#60;p&#62;Anyone any examples of expected behaviour?
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How do I use the new regex? (2.0.9) (simon)</title>
			<link>http://pnotepad.org/forums/topic/439#post-1554</link>
			<pubDate>Thu, 17 Jul 2008 08:14:25 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1554@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;The regular expressions engine can be configured to not match &#60;code&#62;.&#60;/code&#62; against newline characters - perhaps that would be a good idea?
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How do I use the new regex? (2.0.9) (simon)</title>
			<link>http://pnotepad.org/forums/topic/439#post-1553</link>
			<pubDate>Thu, 17 Jul 2008 08:13:55 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1553@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Ah, I see what's happening. The reason for the whole file being matched in this case is that regular expressions are by default greedy and the '.' character is matching line breaks too. This means that the regular expression keeps gobbling characters until it can't match any more. This means that you get the first line start you encounter up to the last line end you encounter.&#60;/p&#62;
&#60;p&#62;To make regex match in non-greedy mode you use the &#60;code&#62;?&#60;/code&#62; character after either &#60;code&#62;*&#60;/code&#62; or &#60;code&#62;+&#60;/code&#62;. Your expression, therefore, would be:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;^.+?$&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;This then correctly matches just one line.
&#60;/p&#62;</description>
		</item>
		<item>
                        <title>How do I use the new regex? (2.0.9) (simon)</title>
			<link>http://pnotepad.org/forums/topic/439#post-1549</link>
			<pubDate>Wed, 16 Jul 2008 09:22:10 +0000</pubDate>
			<dc:creator>simon</dc:creator>
			<guid isPermaLink="false">1549@http://pnotepad.org/forums/</guid>
			<description>&#60;p&#62;Oh, and you're right in that PN now uses standards-conformant syntax so grouping is done with plain parens:&#60;/p&#62;
&#60;p&#62;Capture group: &#60;code&#62;(&#60;/code&#62;...&#60;code&#62;)&#60;/code&#62;&#60;br /&#62;
Left paren:  &#60;code&#62;\(&#60;/code&#62;&#60;br /&#62;
Right paren: &#60;code&#62;\)&#60;/code&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>

