Try a regular expression consisting of two major groups, one containing all text before the page number line at the bottom, and the second containing that page number text. Then the replace expression would be something like $2$1 Thereby reversing the text in those groups. Jamal On Thu, 21 May 2009, Dean Martineau wrote: > Date: Thu, 21 May 2009 13:52:14 -0700 > From: Dean Martineau <dean@xxxxxxxxxxxxxxxxxxxxx> > Reply-To: programmingblind@xxxxxxxxxxxxx > To: programmingblind@xxxxxxxxxxxxx > Subject: moving page numbers around using regular expressions > > I'm trying to use EdSharp to take a document consisting of a book with page > numbers at the bottom of each page and move those numbers to the top. > Hence, I'm using the .net regular expression syntax, though I don't think > I'm doing anything syntax-specific. > > I can use a string, (.+\n\n)+(\d+)\n\n\f > To locate page numbers at the bottom of pages, and this works, but I can't > seem to devise a search and replace sequence that puts the page number at > the top of the correct page. Perhaps I need to use lookahead or lookbehind, > which I don't understand. It seems like something like this should be > possible, but I can't quite get it done. I will appreciate any guidance. > > Thanks. > > Dean > > __________ > View the list's information and change your settings at > //www.freelists.org/list/programmingblind > __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind