summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2018-11-15 13:39:59 -0200
committerEike Rathke <erack@redhat.com>2018-11-16 19:16:39 +0100
commit7c62f2e63ed7a43014b3a4655bc73153110aedcb (patch)
treeada93954314744c53e930e3b95bc40f4ad9e680d
parent605b97155ebd7ee6061153148974a76c16f15fbd (diff)
tdf#121084 Help page for Calc REGEX function
* honor DTD * follow erAck advise Change-Id: Ib911888fbc5aae9c4a749c9343218081df9f6783 Reviewed-on: https://gerrit.libreoffice.org/63430 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--AllLangHelp_scalc.mk1
-rw-r--r--source/text/scalc/01/04060110.xhp4
-rw-r--r--source/text/scalc/01/func_regex.xhp44
3 files changed, 49 insertions, 0 deletions
diff --git a/AllLangHelp_scalc.mk b/AllLangHelp_scalc.mk
index b04311c82e..d55d6abbfd 100644
--- a/AllLangHelp_scalc.mk
+++ b/AllLangHelp_scalc.mk
@@ -231,6 +231,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,scalc,\
helpcontent2/source/text/scalc/01/func_numbervalue \
helpcontent2/source/text/scalc/01/func_now \
helpcontent2/source/text/scalc/01/func_rawsubtract \
+ helpcontent2/source/text/scalc/01/func_regex \
helpcontent2/source/text/scalc/01/func_roundsig \
helpcontent2/source/text/scalc/01/func_second \
helpcontent2/source/text/scalc/01/func_skewp \
diff --git a/source/text/scalc/01/04060110.xhp b/source/text/scalc/01/04060110.xhp
index 162145bd2a..6f50c90964 100644
--- a/source/text/scalc/01/04060110.xhp
+++ b/source/text/scalc/01/04060110.xhp
@@ -492,6 +492,10 @@
<paragraph id="par_id3155364" role="paragraph" xml-lang="en-US"> <item type="input">=PROPER("open office")</item> returns Open Office.</paragraph>
</section>
+<section id="regex">
+<embed href="text/scalc/01/func_regex.xhp#func_regex"/>
+</section>
+
<section id="replace">
<bookmark xml-lang="en-US" branch="index" id="bm_id3149171">
<bookmark_value>REPLACE function</bookmark_value>
diff --git a/source/text/scalc/01/func_regex.xhp b/source/text/scalc/01/func_regex.xhp
new file mode 100644
index 0000000000..f83cfac180
--- /dev/null
+++ b/source/text/scalc/01/func_regex.xhp
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+ <!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ -->
+
+ <meta>
+ <topic id="calcfuncregex" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">REGEX Function</title>
+ <filename>/text/scalc/01/func_regex.xhp</filename>
+ </topic>
+ </meta>
+ <body>
+ <section id="func_regex">
+ <bookmark id="bm_id61542230672099" xml-lang="en-US" branch="hid/SC_HID_FUNC_REGEX" localize="false"/>
+ <bookmark xml-lang="en-US" branch="index" id="bm_id831542233029549">
+ <bookmark_value>REGEX function</bookmark_value>
+ <bookmark_value>regular expressions;extracting in spreadsheets</bookmark_value>
+ <bookmark_value>regular expressions;REGEX function</bookmark_value>
+ </bookmark>
+ <paragraph id="hd_id961542230672100" role="heading" level="1" xml-lang="en-US"><link href="text/scalc/01/func_regex.xhp" name="function REGEX">REGEX</link></paragraph>
+ <paragraph id="par_id541542230672101" role="paragraph" xml-lang="en-US"><variable id="func_regex_desc"><ahelp hid=".">Matches and extracts or optionally replaces text using regular expressions.</ahelp></variable></paragraph>
+ </section>
+ <embed href="text/scalc/01/ful_func.xhp#func_head_syntax"/>
+ <paragraph role="code" id="par_id701542231253817" xml-lang="en-US">REGEX( Text ; Expression [ ; [ Replacement ] [ ; Flags ] ] )</paragraph>
+ <paragraph role="paragraph" id="par_id621542232197446" xml-lang="en-US"><emph>Text</emph>: A text or reference to a cell where the regular expression is to be applied.</paragraph>
+ <paragraph role="paragraph" id="par_id211542232209275" xml-lang="en-US"><emph>Expression</emph>: A text representing the regular expression, using <link href="https://userguide.icu-project.org/strings/regexp" name="ICU REGEXP">ICU regular expressions</link>. If there is no match, #N/A is returned.</paragraph>
+ <paragraph role="paragraph" id="par_id581542232755604" xml-lang="en-US"><emph>Replacement</emph>: Optional. The replacement text and references to capture groups. If there is no match, <emph>Text</emph> is returned unmodified.</paragraph>
+ <paragraph role="paragraph" id="par_id421542232246840" xml-lang="en-US"><emph>Flags</emph>: Optional. "g" replaces all matches of <emph>Expression</emph> in <emph>Text</emph>, not extracted. If there is no match, <emph>Text</emph> is returned unmodified.</paragraph>
+ <embed href="text/scalc/01/ful_func.xhp#func_head_example"/>
+ <paragraph role="paragraph" id="par_id371542291684176" xml-lang="en-US"><item type="input">=REGEX("123456ABCDEF";"[:digit:]";"Z")</item> returns "Z23456ABCDEF", where the first match of a digit is replaced by "Z".</paragraph>
+ <paragraph role="paragraph" id="par_id891542291697194" xml-lang="en-US"><item type="input">=REGEX("123456ABCDEF";"[:digit:]";"Z";"g")</item> returns "ZZZZZZABCDEF", where all digits were replaced by "Z".</paragraph>
+ <paragraph role="paragraph" id="par_id21542291705695" xml-lang="en-US"><item type="input">=REGEX("123456ABCDEF";"[1|2|6]";"";"g")</item> returns "345ABCDEF", where any occurrence of "1", "2" or "6" is replaced by the empty string, thus deleted. </paragraph>
+ <section id="relatedtopics">
+ <paragraph role="paragraph" id="par_id711542233602553" xml-lang="en-US"><link href="text/shared/01/02100001.xhp" name="regex lists">List of regular expressions</link></paragraph>
+ <paragraph role="paragraph" id="par_id431542233650614" xml-lang="en-US"><link href="https://userguide.icu-project.org/strings/regexp" name="ICU REGEXP">ICU regular expressions</link></paragraph>
+ </section>
+</body>
+</helpdocument>