Talk:Documentation/How Tos/Regular Expressions in Writer

From Apache OpenOffice Wiki
Jump to: navigation, search

References

Some of the matters arising with regex can be found in the OOo archives:

bugs:

http://www.oooforum.org/forum/viewtopic.phtml?t=39589

http://www.oooforum.org/forum/viewtopic.phtml?t=64265&highlight=regular

http://www.oooforum.org/forum/viewtopic.phtml?t=61200&highlight=regular


discussion:

http://www.oooforum.org/forum/viewtopic.phtml?t=8665&highlight=regular

http://www.oooforum.org/forum/viewtopic.phtml?t=61857&highlight=regular


issue:

http://qa.openoffice.org/issues/show_bug.cgi?id=15666 (now RESOLVED FIXED)


Examples

This is probably too arcane, but here's a discussion on the black art of finding octal, decimal, & hexadecimal numbers in Writer http://www.oooforum.org/forum/viewtopic.phtml?t=66319

Octal   \<0[0-7]*\>
Decimal \<[1-9][0-9]*\>
Hex     \<0x[A-Fa-f0-9]+\>


Workarounds

In at least some versions of Linux it is possible to use unicode input to directly type a newline (line feed / soft line break/ U+000A) in the "Replace with" input box. There are no reports so far of this working on any other OS.

http://user.services.openoffice.org/en/forum/viewtopic.php?p=2842#p2842

This means that for some people it is possible to insert a newline using Find & Replace.

http://en.wikipedia.org/wiki/Unicode#Input_methods

http://www.fileformat.info/tip/microsoft/enter_unicode.htm

http://www.fileformat.info/info/unicode/char/000a/


Versioning of regex howto in future

See my comment under the same heading in Talk:Documentation/How Tos/Regular Expressions in Calc --Hgreenhough 12:05, 13 December 2007 (CET)

Thanks - I responded there --Drking 10:00, 18 January 2008 (GMT)

Backreferences

http://www.openoffice.org/issues/show_bug.cgi?id=15666#desc100 describes a glitch in the new backreference feature. It does not seem to have been reported as a seperate issue, so may not get picked up. One to test for!

Capitalize words beginning with h:
s/\<h([a-z]+)/
r/H$1/
Match case = Yes

Starting text:   He heard quiet steps behind him.
Expected result: He Heard quiet steps behind Him.
Actual result:   He H$1 quiet steps behind H$1


http://qa.openoffice.org/issues/show_bug.cgi?id=84922 describes a situation where backreferences do not work in find, although I can't follow it myself.

>>>>>>

I've commented in issue 84922 - I don't think this is a bug in OOo

--Drking 7:00, 26 January 2008 (GMT)


External Links

Someone (Andrewz) has added a couple of external links. Absolutely great that people are getting involved, but I'm not sure that external links are a good idea - thoughts welcome...


The application Help is planned to be wiki based in the future, so that people like us can contribute easily. This page links from the Calc function Help (in preparation) and probably will link from Writer Help in the long term. It may or may not be included in Help, depending on space. I hope at the very least that it will be brought up in a browser on clicking in the Help.


As it stands clicking on the external links in this page takes the user away from the Help system and the Wiki altogether - the only way back is via the back button. That's a bad thing.


Another thing is that in my view the purpose of this HowTo is to give the user the information - not to present him with stuff within which information can be found. So if the info on the linked pages is useful it should be in the HowTo.


And a third thing is that there are plenty of external pages that could be linked to - everyone has their own favourite - but this shouldn't be a directory for them.


Interested to know any other views....

--Drking 05:00, 23 January 2008 (GMT)


Agreed. 'Concise, precise, complete', is best. I think the links would be better here in Talk, under a heading such as 'External Links', or 'Further Reading', so they could be used for research by editors (and anyone else interested).

--Hgreenhough 11:03, 23 January 2008 (CET)


Thanks - can't tackle it right now, but doutless one of us will...

--Drking 8:45, 24 January 2008 (GMT)


I've changed my mind. How about an 'External Links' section at the end of the article, like on Wikipedia? That way they're easy to find (very few visitors will ever look at the discussion), all together (for easier maintenance), but clearly seperate.


--Hgreenhough 13:52, 25 January 2008 (CET)

Still thinking about it - not quite convinced - at the moment our content is (I hope) pretty definitive. External pages might not be (for instance although the Andrewz links are pretty good, there are some things that I'd take issue with, like the e-address regex needs case-insensitive). Perhaps if our 'External Links' section made it clear they were simply additional pages, and took you away from the wiki?

I cannot find a way to open an external link in a new browser - which really ought to be possible. Any ideas?

--Drking 7:00, 25 January 2008 (GMT)

Is OpenOffice.org not as much a community as it is a product? While a link dump is bad, a moderated selections of links may benefit the end user. Wikipedia, which has an offline edition, includes a few links to external sites. Also, for what it's worth, even Microsoft Office's built-in help includes links.

Taking the argument further and generalizing it to the whole Documentation section of the wiki: if you remove all links, what else would you remove now or prevent from being included in the future?

Drking: about the email address regex. OOo does case insensitive matching by default. You suggest I change a-z to a-zA-Z?

--Andrewz 01:43, 28 January 2008 (CET)

OOo 3.0 Help links

The application help of OOo 3.0 links to this Wiki page and the one for Calc. The links are below the list of regular expressions:


We would like to improve the application help by inserting many more links leading to Wiki pages.

>>>>>>>>>

(noting the above comment from 'Ufi')

Excellent! thank you Uwe

--Drking 8:45, 24 January 2008 (GMT)

Personal tools