Reguláris kifejezések listája

Kifejezés

Reprezentáció/használat

Bármely karakter

Az adott karakter, kivéve, ha az egy reguláris kifejezés metakaraktere. A metakarakterek listája ebben a táblázatban következik.

.

Bármely karaktert jelöli a sortörés- és a „bekezdés vége” jel kivételével. Például a „f.l” megtalálja a „fül” és a „fal” szót is.

^

The beginning of a paragraph or cell. Special objects such as empty fields or character-anchored frames, at the beginning of a paragraph are ignored. Example: "^Peter" matches the word "Peter" only when it is the first word of a paragraph.

$

The end of a paragraph or cell. Special objects such as empty fields or character-anchored frames at the end of a paragraph are ignored. Example: "Peter$" matches only when the word "Peter" is the last word of a paragraph, note "Peter" cannot be followed by a period.

A $ önmagában a bekezdés végére illeszkedik. Így a bekezdéstörések megkereshetők és kicserélhetők.

*

Zero or more of the regular expression term immediately preceding it. For example, "Ab*c" matches "Ac", "Abc", "Abbc", "Abbbc", and so on.

+

One or more of the regular expression term immediately preceding it. For example, "AX.+4" finds "AXx4", but not "AX4".

The longest possible string that matches this regular expression in a paragraph is always matched. If the paragraph contains the string "AX 4 AX4", the entire passage is highlighted.

?

Zero or one of the regular expression term immediately preceding it. For example, "Texts?" matches "Text" and "Texts" and "x(ab|c)?y" finds "xy", "xaby", or "xcy".

\

The special character that follows it is interpreted as a normal character and not as a regular expression meta character (except for the combinations "\n", "\t", "\b", "\>" and "\<"). For example, "tree\." matches "tree.", not "treed" or "trees".

\n

A Keresés szövegmezőben a Shift+Enter billentyűkombinációval beillesztett sortörés.

A paragraph break that can be entered with the Enter or Return key when in the Replace text box in Writer. Has no special meaning in Calc, and is treated literally there.

To change line breaks into paragraph breaks, enter \n in both the Find and Replace boxes, and then perform a search and replace.

\t

Egy tabulátor karakter. A Csere mezőben is használható.

\b

Egy szó határa. Például a "\bkönyv" megfelel a "könyvjelző" és a "könyv" szónak, de nem a "tankönyv" szónak, míg a "könyv\b" megfelel a "tankönyv" és a "könyv" szónak, de nem a "könyvjelző" szónak.

Note, this form replaces the obsolete (although they still work for now) forms "\>" (match end of word) and "\<" (match start of word).

^$

Egy üres bekezdést keres meg.

^.

Egy bekezdés első karakterét keresi meg.

& vagy $0

Adds the string that was found by the search criteria in the Find box to the term in the Replace box when you make a replacement.

For example, if you enter "window" in the Find box and "&frame" in the Replace box, the word "window" is replaced with "windowframe".

You can also enter an "&" in the Replace box to modify the Attributes or the Format of the string found by the search criteria.

[...]

Any single occurrence of any one of the characters that are between the brackets. For example: "[abc123]" matches the characters ‘a’, ‘b’, ’c’, ‘1’, ‘2’ and ‘3’. "[a-e]" matches single occurrences of the characters a through e, inclusive (the range must be specified with the character having the smallest Unicode code number first). "[a-eh-x]" matches any single occurrence of the characters that are in the ranges ‘a’ through ‘e’ and ‘h’ through ‘x’.

[^...]

Any single occurrence of a character, including Tab, Space and Line Break characters, that is not in the list of characters specified inclusive ranges are permitted. For example "[^a-syz]" matches all characters not in the inclusive range ‘a’ through ‘s’ or the characters ‘y’ and ‘z’.

\uXXXX

\UXXXXXXXX

A négyjegyű hexadecimális Unicode-kód (XXXX) által képviselt karakter.

A nyolcjegyű hexadecimális Unicode-kód (XXXXXXXX) által képviselt karakter.

For certain symbol fonts the symbol (glyph) that you see on screen may look related to a different Unicode code than what is actually used for it in the font. The Unicode codes can be viewed by choosing Insert - Special Character, or by using Unicode conversion shortcut.

|

The infix operator delimiting alternatives. Matches the term preceding the "|" or the term following the "|". For example, "this|that" matches occurrences of both "this" and "that".

{N}

The post-fix repetition operator that specifies an exact number of occurrences ("N") of the regular expression term immediately preceding it must be present for a match to occur. For example, "tre{2}" matches "tree".

{N,M}

The post-fix repetition operator that specifies a range (minimum of "N" to a maximum of "M") of occurrences of the regular expression term immediately preceding it that can be present for a match to occur. For example, "tre{1,2}" matches "tre" and "tree".

{N,}

The post-fix repetition operator that specifies a range (minimum "N" to an unspecified maximum) of occurrences of the regular expression term immediately preceding it that can be present for a match to occur. (The maximum number of occurrences is limited only by the size of the document). For example, "tre{2,}" matches "tree", "treee", and "treeeee".

(...)

A csoportosítási konstrukció, amely három célt szolgál.

  1. To enclose a set of ‘|’ alternatives. For example, the regular expression "b(oo|ac)k" matches both "book" and "back".

  2. To group terms in a complex expression to be operated on by the post-fix operators: "*", "+" and "?" along with the post-fix repetition operators. For example, the regular expression "a(bc)?d" matches both "ad" and "abcd" in a search.; the regular expression "M(iss){2}ippi" matches "Mississippi".

  3. To record the matched sub string inside the parentheses as a reference for later use in the Find box using the "\n" construct or in the Replace box using the "$n" construct. The reference to the first match is represented by "\1" in the Find box and by "$1" in the Replace box. The reference to the second matched sub string by "\2" and "$2" respectively, and so on.

Például a "(890)7\1\1\1" reguláris kifejezés megfelel a "8907890890" kifejezésnek.

With the regular expression "\b(fruit|truth)\b" in the Find box and the regular expression "$1ful" in the Replace box occurrences of the words "fruit" and "truth" can be replaced with the words "fruitful" and "truthful" respectively without affecting the words "fruitfully" and "truthfully"

[:alpha:]

Egy alfabetikus karaktert képvisel. A [:alfa:]+ használatával kereshetjük meg valamelyiket.

[:digit:]

Egy tizedesjegyet jelöl. Használja a [:számjegy:]+ parancsot, hogy megtalálja valamelyiket.

[:alnum:]

Egy alfanumerikus karaktert jelöl ([:alpha:] és [:digit:]).

[:space:]

Szóköz karaktert jelöl (de nem a többi üres karaktert).

[:print:]

Egy nyomtatható karaktert jelöl.

[:cntrl:]

Nem nyomtatható karaktert jelöl.

[:lower:]

Kisbetűs karaktereket jelöl, ha a Beállítások részben ki van választva a Kis- és nagybetűk megkülönböztetése lehetőség.

[:upper:]

Nagybetűs karaktereket jelöl, ha a Beállítások részben ki van választva a Kis- és nagybetűk megkülönböztetése lehetőség.


A támogatott metakarakterek és szintaxis teljes listáját lásd az ICU Regular Expressions dokumentációban.

A reguláris kifejezéseket összetett és kifinomult reguláris kifejezésekké lehet kombinálni a keresésekhez, amint azt a következő példák mutatják.

Példák

Kifejezés

Jelentés

^$

Egy üres bekezdés.

^ specifies that the match must be at the start of a paragraph,

$ megadja, hogy az illesztett karakterláncot egy bekezdésjelnek vagy egy cella végének kell követnie.

^.

Egy bekezdés első karaktere.

^ specifies that the match must be at the start of a paragraph,

. bármely egyetlen karaktert meghatároz.

e([:digit:])?

Matches "e" by itself or an "e" followed by one digit.

e az "e" karaktert adja meg,

[:digit:] bármely tizedesjegyet megad,

? specifies zero or one occurrences of [:digit:].

^([:digit:])$

Pontosan egy számjegyet tartalmazó bekezdést vagy cellákat talál.

^ specifies that the match must be at the start of a paragraph,

[:digit:] bármely tizedesjegyet megad,

$ megadja, hogy az illesztett karakterláncot egy bekezdésjelnek vagy egy cella végének kell követnie.

^[:digit:]{3}$

Csak három számjegyű számokat tartalmazó bekezdést vagy cellát keres

^ specifies that the match must be at the start of a paragraph,

[:digit:] bármely tizedesjegyet megad,

{3} specifies that [:digit:] must occur three times,

$ megadja, hogy az illesztett karakterláncot egy bekezdésjelnek vagy egy cella végének kell követnie.

\bconst(itu|ruc)tion\b

Matches the words "constitution" and "construction" but not the word "constitutional."

\b megadja, hogy az egyezésnek szóhatáron kell kezdődnie,

const a "const" karaktereket határozza meg,

( elindítja a csoportot,

itu az "itu" karaktereket határozza meg,

| meghatározza az alternatívát,

ruc a "ruc" karaktereket határozza meg,

) befejezi a csoportot,

tion a "tion" karaktereket határozza meg,

\b megadja, hogy az egyezésnek szóhatáron kell végződnie.