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


At 23:26 24/08/2013 +0200, Pier Andreit wrote:
[...]
I cannot understand this part:
SEARCH("/[^/]*$", CELL("filename"))
I know it search in CELL("filename") but I cannot understand the criteria "/[^/]*$" from the tests it seems to find the last "/" in any string, and if you substitute the "/" with "." it works again finding the last ".", it is very useful .... :-) :-) :-) :-)
could somebody so marvellously noble and well-bred to explain the 
regular expressions here used??
I'm not even ordinarily noble - certainly not marvellously so - and I 
was only ordinarily bred; will I do?
The first character in the text string is the slash that you are 
looking for.  A string in square brackets matches any single 
character which appears in that string.  But if the first character 
is a circumflex (as here), it matches any single character *not* in 
that string.  So leftbracket-circumflex-slash-rightbracket matches 
any single character other than a slash.  The asterisk following this 
pattern causes a match with zero or more characters (as many as 
possible, in fact) preceding it - in this case the bracketed 
string.  So the bracketed part followed by the asterisk together 
match as many characters as possibly not including a slash.  The 
dollar sign locks the pattern to the end of a paragraph - in this 
case, the end of the entire text in the cell.  So the whole string 
finds a slash followed by many not-slash characters, but only at the 
end of the string.  As you say, that means everything from the last 
slash in the string to the end.  The SEARCH() function then returns 
the position of the start of the matched text: the position of the last slash.
...a couple of beer paid for you...:-) :-) :-)
How kind!  I'll enquire of my mail service provider how soon they can 
permit liquid attachments.
I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: users+unsubscribe@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.