tag:blogger.com,1999:blog-8544609315733972726.post5518316248526131441..comments2008-04-17T12:56:18.559-06:00Comments on OpenOffice.org Ninja: Backreferences in replacementsAndrew Zhttp://www.blogger.com/profile/10108637160465346326noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-8544609315733972726.post-4619813899537767512008-04-17T12:56:00.000-06:002008-04-17T12:56:00.000-06:00Orn: No, the year remains in YYYY, 4-digit format,...Orn: No, the year remains in YYYY, 4-digit format, so the first example just shuffles the locations and changes the delimiters. However, I updated the article to be a little more clear.Andrew Zhttp://www.blogger.com/profile/10108637160465346326noreply@blogger.comtag:blogger.com,1999:blog-8544609315733972726.post-30650023493905580662008-04-15T15:19:00.000-06:002008-04-15T15:19:00.000-06:00In your first example, doesn't the example have th...In your first example, doesn't the example have the stated goal of changing the year to 2 digits YY from original 4 digits YYYY? (besides changing year location)?Ornnoreply@blogger.comtag:blogger.com,1999:blog-8544609315733972726.post-14892643865122694542008-02-11T02:06:00.000-07:002008-02-11T02:06:00.000-07:00D'oh! This is pretty clear from the title of the a...D'oh! This is pretty clear from the title of the article - I should have spotted it, sorry. Many thanks for taking the time to respond.DanOtterburnhttp://www.blogger.com/profile/01167985840323201562noreply@blogger.comtag:blogger.com,1999:blog-8544609315733972726.post-49853284427618206432008-02-07T07:03:00.000-07:002008-02-07T07:03:00.000-07:00Dan,You need OpenOffice.org 2.4 which is due as a ...Dan,<BR/><BR/>You need OpenOffice.org 2.4 which is due as a final release March 2008. Until then, you can <A HREF="http://download.openoffice.org/680/index.html" REL="nofollow">test the unstable developer's snapshot</A>.<BR/><BR/><BR/>AndrewAndrew Zhttp://www.blogger.com/profile/10108637160465346326noreply@blogger.comtag:blogger.com,1999:blog-8544609315733972726.post-62069566716450804492008-02-07T04:54:00.000-07:002008-02-07T04:54:00.000-07:00Even with "Regular expressions" checked, my backre...Even with "Regular expressions" checked, my backreferences are treated as literals. For example, cell contains "foobar", search is "(foobar)", replace is "$1"; this gives me "$1" in the cell _not_ "foobar".<BR/><BR/>I am familiar with regex but not OpenOffice - I guess I am missing a trick somewhere. Have you come across this behaviour before?<BR/><BR/>(OOO 2.3.0 on Fedora Core 7)DanOtterburnhttp://www.blogger.com/profile/01167985840323201562noreply@blogger.comtag:blogger.com,1999:blog-8544609315733972726.post-12293978553260313762008-01-24T19:56:00.000-07:002008-01-24T19:56:00.000-07:00Anonymous,I could see how that is confusing. The ...Anonymous,<BR/><BR/>I could see how that is confusing. The $1 refers to the first group in parenthesis. There is only one group, so $1 is correct. <BR/><BR/>If the search expression were ([0-9]{3})-([0-9]{2})-([0-9]{4}) the replacement could be XXX-XX-$3 and produce the same results. <BR/><BR/>I did forget the closing parenthesis, so I'm glad you encouraged me to take another look.<BR/><BR/><BR/>AndrewAndrew Zhttp://www.blogger.com/profile/10108637160465346326noreply@blogger.comtag:blogger.com,1999:blog-8544609315733972726.post-68808481028856185832008-01-24T18:15:00.000-07:002008-01-24T18:15:00.000-07:00Looking at your two examples would the 'replace' i...Looking at your two examples would the 'replace' in the "Redacting the SSN" be XXX-XX-$3 instead of XXX-XX-$1 ??Anonymousnoreply@blogger.com