forked from amazingfate/help
343 lines
18 KiB
XML
Executable File
343 lines
18 KiB
XML
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
***********************************************************************
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* $RCSfile: 02100001.xhp,v $
|
|
*
|
|
* $Revision: 1.7 $
|
|
*
|
|
* last change: $Author: rt $ $Date: 2006-12-01 16:54:04 $
|
|
*
|
|
* The Contents of this file are made available subject to
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
|
*
|
|
*
|
|
* GNU Lesser General Public License Version 2.1
|
|
* =============================================
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
* MA 02111-1307 USA
|
|
*
|
|
************************************************************************
|
|
-->
|
|
|
|
<helpdocument version="1.0">
|
|
<meta>
|
|
<topic id="textshared0102100001xml" indexer="include" status="PUBLISH">
|
|
<title id="tit" xml-lang="en-US">List of Regular Expressions</title>
|
|
<filename>/text/shared/01/02100001.xhp</filename>
|
|
</topic>
|
|
<history>
|
|
<created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created>
|
|
<lastedited date="2006-10-10T11:17:47">UFI: fixed #i24613#, plus many changes due to #i18379#</lastedited>
|
|
</history>
|
|
</meta>
|
|
<body>
|
|
<bookmark xml-lang="en-US" branch="index" id="bm_id3146765"><bookmark_value>regular expressions; list of</bookmark_value>
|
|
<bookmark_value>lists;regular expressions</bookmark_value>
|
|
</bookmark>
|
|
<paragraph role="heading" id="hd_id3146765" xml-lang="en-US" level="1" l10n="U" oldref="203"><variable id="02100001"><link href="text/shared/01/02100001.xhp">List of Regular Expressions</link>
|
|
</variable></paragraph>
|
|
<table id="tbl_id3149517">
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablehead" id="par_id3149741" xml-lang="en-US" l10n="U" oldref="17">Character</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablehead" id="par_id3155577" xml-lang="en-US" l10n="U" oldref="18">Result/Use</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id6600543" xml-lang="en-US" l10n="NEW">Any character</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id9824518.00000001" xml-lang="en-US" l10n="NEW">Represents any single character unless otherwise specified.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3152427" xml-lang="en-US" l10n="U" oldref="19">.</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3149031" xml-lang="en-US" l10n="CHG" oldref="20">Represents any single character except for a line break or paragraph break. For example, the search term "sh.rt" returns both "shirt" and "short".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3154682" xml-lang="en-US" l10n="CHG" oldref="21">^</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3155351" xml-lang="en-US" l10n="CHG" oldref="22">Only finds the search term if the term is at the beginning of a paragraph. Special objects such as empty fields or character-anchored frames, at the beginning of a paragraph are ignored. Example: "^Peter".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3159194" xml-lang="en-US" l10n="CHG" oldref="23">$</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3152542" xml-lang="en-US" l10n="CHG" oldref="24">Only finds the search term if the term appears at the end of a paragraph. Special objects such as empty fields or character-anchored frames at the end of a paragraph are ignored. Example: "Peter$".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3156414" xml-lang="en-US" l10n="U" oldref="25">*</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3155555" xml-lang="en-US" l10n="CHG" oldref="26">Finds zero or more of the characters in front of the "*". For example, "Ab*c" finds "Ac", "Abc", "Abbc", "Abbbc", and so on.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3147399" xml-lang="en-US" l10n="U" oldref="27">+</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3157958" xml-lang="en-US" l10n="CHG" oldref="28">Finds one or more of the characters in front of the "+". For example, "AX.+4" finds "AXx4", but not "AX4".</paragraph>
|
|
<paragraph role="tablecontent" id="par_id3145313" xml-lang="en-US" l10n="U" oldref="207">The longest possible string that matches this search pattern in a paragraph is always found. If the paragraph contains the string "AX 4 AX4", the entire passage is highlighted.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3143267" xml-lang="en-US" l10n="U" oldref="199">?</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153684" xml-lang="en-US" l10n="CHG" oldref="200">Finds zero or one of the characters in front of the "?". For example, "Texts?" finds "Text" and "Texts" and "x(ab|c)?y" finds "xy", "xaby", or "xcy".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3166410" xml-lang="en-US" l10n="U" oldref="158">\</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3147209" xml-lang="en-US" l10n="CHG" oldref="159">Search interprets the special character that follows the "\" as a normal character and not as a regular expression (except for the combinations \n, \t, \>, and \<). For example, "tree\." finds "tree.", not "treed" or "trees".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3152945" xml-lang="en-US" l10n="U" oldref="166">\n</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153700" xml-lang="en-US" l10n="CHG" oldref="167">Represents a line break that was inserted with the Shift+Enter key combination. To change a line break into a paragraph break, enter <emph>\n</emph> in the <emph>Search for</emph> and <emph>Replace with</emph> boxes, and then perform a search and replace.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153258" xml-lang="en-US" l10n="U" oldref="29">\t</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3157809" xml-lang="en-US" l10n="CHG" oldref="30">Represents a tab. You can also use this expression in the <emph>Replace with</emph> box.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3146775" xml-lang="en-US" l10n="U" oldref="33">\></paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3148644" xml-lang="en-US" l10n="U" oldref="34">Only finds the search term if it appears at the end of a word. For example, "book\>" finds "checkbook", but not "bookmark".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3150670" xml-lang="en-US" l10n="U" oldref="35">\<</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153666" xml-lang="en-US" l10n="CHG" oldref="36">Only finds the search term if it appears at the beginning of a word. For example, "\<book" finds "bookmark", but not "checkbook".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3149576" xml-lang="en-US" l10n="U" oldref="37">^$</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3151245" xml-lang="en-US" l10n="CHG" oldref="38">Finds an empty paragraph.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3148550" xml-lang="en-US" l10n="U" oldref="41">^.</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3159413" xml-lang="en-US" l10n="CHG" oldref="42">Finds the first character of a paragraph.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3147282" xml-lang="en-US" l10n="U" oldref="43">&</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153961" xml-lang="en-US" l10n="CHG" oldref="44">Adds the string that was found by the search criteria in the <emph>Search for</emph> box to the term in the <emph>Replace with</emph> box when you make a replacement.</paragraph>
|
|
<paragraph role="tablecontent" id="par_id3149650" xml-lang="en-US" l10n="CHG" oldref="201">For example, if you enter "window" in the <emph>Search for</emph> box and "&frame" in the <emph>Replace with</emph> box, the word "window" is replaced with "windowframe".</paragraph>
|
|
<paragraph role="tablecontent" id="par_id3150543" xml-lang="en-US" l10n="CHG" oldref="206">You can also enter an "&" in the <emph>Replace with</emph> box to modify the <emph>Attributes</emph> or the <emph>Format</emph> of the string found by the search criteria.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3145419" xml-lang="en-US" l10n="U" oldref="172">[abc123]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3154630" xml-lang="en-US" l10n="CHG" oldref="173">Represents one of the characters that are between the brackets.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3156293" xml-lang="en-US" l10n="U" oldref="174">[a-e]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3149167" xml-lang="en-US" l10n="CHG" oldref="175">Represents any of the characters that are between a and e.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3155994" xml-lang="en-US" l10n="U" oldref="176">[a-eh-x]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3148676" xml-lang="en-US" l10n="CHG" oldref="177">Represents any of the characters that are between a-e and h-x.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3145318" xml-lang="en-US" l10n="U" oldref="178">[^a-s]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153351" xml-lang="en-US" l10n="CHG" oldref="179">Represents any character that is not between a and s.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3156543" xml-lang="en-US" l10n="U" oldref="180">\xXXXX</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153768" xml-lang="en-US" l10n="U" oldref="181">Represents a special character based on its four-digit hexadecimal code (XXXX).</paragraph>
|
|
<paragraph role="tablecontent" id="par_id3159252" xml-lang="en-US" l10n="U" oldref="208">The code for the special character depends on the font used. You can view the codes by choosing <emph>Insert - Special Character</emph>.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153951" xml-lang="en-US" l10n="U" oldref="186">|</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3154985" xml-lang="en-US" l10n="CHG" oldref="187">Finds the terms that occur before or after the "|". For example, "this|that" finds "this" and "that".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3147376" xml-lang="en-US" l10n="U" oldref="209">{2}</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3150103" xml-lang="en-US" l10n="U" oldref="210">Defines the number of times that the character in front of the opening bracket occurs. For example, "tre{2}" finds "tree".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3151289" xml-lang="en-US" l10n="U" oldref="211">{1,2}</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3147317" xml-lang="en-US" l10n="U" oldref="212">Defines the number of times that the character in front of the opening bracket can occur. For example, "tre{1,2}" finds both "tree" and "treated".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id4870754" xml-lang="en-US" l10n="NEW">{1,}</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id843836" xml-lang="en-US" l10n="NEW">Defines the minimum number of times that the character in front of the opening bracket can occur. For example, "tre{2,}" finds "tree", "treee", and "treeeee".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3148616" xml-lang="en-US" l10n="U" oldref="213">( )</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153573" xml-lang="en-US" l10n="CHG" oldref="214">Defines the characters inside the parentheses as a reference. You can then refer to the first reference in the current expression with "\1", to the second reference with "\2", and so on.</paragraph>
|
|
<paragraph role="tablecontent" id="par_id3156061" xml-lang="en-US" l10n="U" oldref="215">For example, if your text contains the number 13487889 and you search using the regular expression (8)7\1\1, "8788" is found.</paragraph>
|
|
<paragraph role="tablecontent" id="par_id2367931" xml-lang="en-US" l10n="NEW">You can also use () to group terms, for example, "a(bc)?d" finds "ad" or "abcd".</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3152885" xml-lang="en-US" l10n="U" oldref="216">[:digit:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3150010" xml-lang="en-US" l10n="CHG" oldref="217">Represents a decimal digit.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153726" xml-lang="en-US" l10n="U" oldref="218">[:space:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3150961" xml-lang="en-US" l10n="CHG" oldref="219">Represents a white space character such as space.<comment>UFI: see #i41706#</comment></paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3150486" xml-lang="en-US" l10n="U" oldref="220">[:print:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3150872" xml-lang="en-US" l10n="CHG" oldref="221">Represents a printable character.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3155854" xml-lang="en-US" l10n="U" oldref="222">[:cntrl:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3152576" xml-lang="en-US" l10n="CHG" oldref="223">Represents a nonprinting character.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153743" xml-lang="en-US" l10n="U" oldref="224">[:alnum:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3153281" xml-lang="en-US" l10n="CHG" oldref="225">Represents an alphanumeric character ([:alpha:] and [:digit:]).</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3154790" xml-lang="en-US" l10n="U" oldref="226">[:alpha:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3147397" xml-lang="en-US" l10n="CHG" oldref="227">Represents an alphabetic character.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3149958" xml-lang="en-US" l10n="U" oldref="228">[:lower:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3145730" xml-lang="en-US" l10n="CHG" oldref="229">Represents a lowercase character if <emph>Match case</emph> is selected in <emph>Options</emph>.</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
<tablerow>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3148455" xml-lang="en-US" l10n="U" oldref="230">[:upper:]</paragraph>
|
|
</tablecell>
|
|
<tablecell colspan="" rowspan="">
|
|
<paragraph role="tablecontent" id="par_id3150092" xml-lang="en-US" l10n="CHG" oldref="231">Represents an uppercase character if <emph>Match case</emph> is selected in <emph>Options.</emph>
|
|
</paragraph>
|
|
</tablecell>
|
|
</tablerow>
|
|
</table>
|
|
<comment>deleted a misleading para</comment>
|
|
<section id="relatedtopics">
|
|
<embed href="text/shared/01/02100000.xhp#02100000"/>
|
|
</section>
|
|
</body>
|
|
</helpdocument>
|