Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


At 12:05 09/10/2012 +1300, Steve Edmonds wrote:
I have had a look, and before I go writing a macro I thought I would check there is no easier solution. I want to return the part of a string in a cell matched by a regular expression. I have strings in cells that could be X12.4Y.2Z1.234 or any combination of any letter followed by a number. I want to be able to return the number after a specified letter, not hard in a regexp. I have not been able to find an LO function to do this.

I'm not sure it is an "easier solution", but you could try:
=VALUE(LEFT(MID(Xn;SEARCH("#";Xn)+1;99);SEARCH("[^0-9.]";MID(Xn;SEARCH("#";Xn)+1;99))-1))
- where Xn is the cell containing your original string and # represents your "specified letter".

Note that you need to ensure there is a tick at Tools | Options... | LibreOffice Calc | Calculate | Enable regular expressions in formulas.

But there must be an easier way ...

I trust this helps.

Brian Barker


--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.