CINXE.COM

Wyrażenie regularne – Wikipedia, wolna encyklopedia

<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-sticky-header-enabled vector-toc-available" lang="pl" dir="ltr"> <head> <meta charset="UTF-8"> <title>Wyrażenie regularne – Wikipedia, wolna encyklopedia</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-sticky-header-enabled vector-toc-available";var cookie=document.cookie.match(/(?:^|; )plwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":[",\t."," \t,"],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy", "wgMonthNames":["","styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],"wgRequestId":"d0b9fd3c-2159-48a6-8806-cc630bb88c9b","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Wyrażenie_regularne","wgTitle":"Wyrażenie regularne","wgCurRevisionId":75388257,"wgRevisionId":75388257,"wgArticleId":1493128,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Zalążki sekcji artykułów","Szablon cytowania książki – brak numeru strony","Języki formalne","Konstrukcje programistyczne","Teoria automatów"],"wgPageViewLanguage":"pl","wgPageContentLanguage":"pl","wgPageContentModel":"wikitext","wgRelevantPageName":"Wyrażenie_regularne","wgRelevantArticleId":1493128,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia", "wgCiteReferencePreviewsActive":true,"wgFlaggedRevsParams":{"tags":{"accuracy":{"levels":1}}},"wgStableRevisionId":75388257,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"pl","pageLanguageDir":"ltr","pageVariantFallbacks":"pl"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":20000,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q185612","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={ "ext.gadget.wikiflex":"ready","ext.gadget.infobox":"ready","ext.gadget.hlist":"ready","ext.gadget.darkmode-overrides":"ready","ext.gadget.small-references":"ready","ext.gadget.citation-access-info":"ready","ext.gadget.sprawdz-problemy-szablony":"ready","ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.math.styles":"ready","ext.cite.styles":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.flaggedRevs.basic":"ready","mediawiki.codex.messagebox.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.scribunto.logs","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp", "ext.flaggedRevs.advanced","ext.gadget.ll-script-loader","ext.gadget.veKeepParameters","ext.gadget.szablon-galeria","ext.gadget.NavFrame","ext.gadget.citoid-overrides","ext.gadget.maps","ext.gadget.padlock-indicators","ext.gadget.interwiki-langlist","ext.gadget.edit-summaries","ext.gadget.edit-first-section","ext.gadget.wikibugs","ext.gadget.map-toggler","ext.gadget.narrowFootnoteColumns","ext.gadget.WDsearch","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=pl&amp;modules=ext.cite.styles%7Cext.flaggedRevs.basic%7Cext.math.styles%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cmediawiki.codex.messagebox.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector-2022"> <script async="" src="/w/load.php?lang=pl&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=pl&amp;modules=ext.gadget.citation-access-info%2Cdarkmode-overrides%2Chlist%2Cinfobox%2Csmall-references%2Csprawdz-problemy-szablony%2Cwikiflex&amp;only=styles&amp;skin=vector-2022"> <link rel="stylesheet" href="/w/load.php?lang=pl&amp;modules=site.styles&amp;only=styles&amp;skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.18"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Wyrażenie regularne – Wikipedia, wolna encyklopedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//pl.m.wikipedia.org/wiki/Wyra%C5%BCenie_regularne"> <link rel="alternate" type="application/x-wiki" title="Edytuj" href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (pl)"> <link rel="EditURI" type="application/rsd+xml" href="//pl.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://pl.wikipedia.org/wiki/Wyra%C5%BCenie_regularne"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.pl"> <link rel="alternate" type="application/atom+xml" title="Kanał Atom Wikipedii" href="/w/index.php?title=Specjalna:Ostatnie_zmiany&amp;feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Wyrażenie_regularne rootpage-Wyrażenie_regularne skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Przejdź do zawartości</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Witryna"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" title="Główne menu" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Menu główne" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Menu główne</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Menu główne</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">przypnij</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">ukryj</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Nawigacja </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Wikipedia:Strona_g%C5%82%C3%B3wna" title="Przejdź na stronę główną [z]" accesskey="z"><span>Strona główna</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Specjalna:Losowa_strona" title="Załaduj losową stronę [x]" accesskey="x"><span>Losuj artykuł</span></a></li><li id="n-Kategorie" class="mw-list-item"><a href="/wiki/Portal:Kategorie_G%C5%82%C3%B3wne"><span>Kategorie artykułów</span></a></li><li id="n-Featured-articles" class="mw-list-item"><a href="/wiki/Wikipedia:Wyr%C3%B3%C5%BCniona_zawarto%C5%9B%C4%87_Wikipedii"><span>Najlepsze artykuły</span></a></li><li id="n-FAQ" class="mw-list-item"><a href="/wiki/Pomoc:FAQ"><span>Częste pytania (FAQ)</span></a></li><li id="n-specialpages" class="mw-list-item"><a href="/wiki/Specjalna:Strony_specjalne"><span>Strony specjalne</span></a></li> </ul> </div> </div> <div id="p-zmiany" class="vector-menu mw-portlet mw-portlet-zmiany" > <div class="vector-menu-heading"> Dla czytelników </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-czytelnicy" class="mw-list-item"><a href="/wiki/Wikipedia:O_Wikipedii"><span>O Wikipedii</span></a></li><li id="n-contact" class="mw-list-item"><a href="/wiki/Wikipedia:Kontakt_z_wikipedystami"><span>Kontakt</span></a></li> </ul> </div> </div> <div id="p-edytorzy" class="vector-menu mw-portlet mw-portlet-edytorzy" > <div class="vector-menu-heading"> Dla wikipedystów </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-pierwsze-kroki" class="mw-list-item"><a href="/wiki/Pomoc:Pierwsze_kroki"><span>Pierwsze kroki</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedia:Portal_wikipedyst%C3%B3w" title="O projekcie – co możesz zrobić, gdzie możesz znaleźć informacje"><span>Portal wikipedystów</span></a></li><li id="n-Noticeboard" class="mw-list-item"><a href="/wiki/Wikipedia:Tablica_og%C5%82osze%C5%84"><span>Ogłoszenia</span></a></li><li id="n-Guidelines" class="mw-list-item"><a href="/wiki/Wikipedia:Zasady"><span>Zasady</span></a></li><li id="n-helppage-name" class="mw-list-item"><a href="/wiki/Pomoc:Spis_tre%C5%9Bci"><span>Pomoc</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Specjalna:Ostatnie_zmiany" title="Lista ostatnich zmian w Wikipedii. [r]" accesskey="r"><span>Ostatnie zmiany</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Wikipedia:Strona_g%C5%82%C3%B3wna" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedia" src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" style="width: 7.5em; height: 1.125em;"> <img class="mw-logo-tagline" alt="wolna encyklopedia" src="/static/images/mobile/copyright/wikipedia-tagline-pl.svg" width="120" height="13" style="width: 7.5em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Specjalna:Szukaj" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Przeszukaj Wikipedię [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Szukaj</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Przeszukaj Wikipedię" aria-label="Przeszukaj Wikipedię" autocapitalize="sentences" title="Przeszukaj Wikipedię [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Specjalna:Szukaj"> </div> <button class="cdx-button cdx-search-input__end-button">Szukaj</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Narzędzia osobiste"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Wygląd"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Zmień rozmiar czcionki, szerokość oraz kolorystykę strony" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Wygląd" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Wygląd</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?wmf_source=donate&amp;wmf_medium=sidebar&amp;wmf_campaign=pl.wikipedia.org&amp;uselang=pl" class=""><span>Wspomóż Wikipedię</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Specjalna:Utw%C3%B3rz_konto&amp;returnto=Wyra%C5%BCenie+regularne" title="Zachęcamy do stworzenia konta i zalogowania, ale nie jest to obowiązkowe." class=""><span>Utwórz konto</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Specjalna:Zaloguj&amp;returnto=Wyra%C5%BCenie+regularne" title="Zachęcamy do zalogowania się, choć nie jest to obowiązkowe. [o]" accesskey="o" class=""><span>Zaloguj się</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Więcej opcji" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Narzędzia osobiste" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Narzędzia osobiste</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Menu użytkownika" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?wmf_source=donate&amp;wmf_medium=sidebar&amp;wmf_campaign=pl.wikipedia.org&amp;uselang=pl"><span>Wspomóż Wikipedię</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Specjalna:Utw%C3%B3rz_konto&amp;returnto=Wyra%C5%BCenie+regularne" title="Zachęcamy do stworzenia konta i zalogowania, ale nie jest to obowiązkowe."><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Utwórz konto</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Specjalna:Zaloguj&amp;returnto=Wyra%C5%BCenie+regularne" title="Zachęcamy do zalogowania się, choć nie jest to obowiązkowe. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Zaloguj się</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Strony dla anonimowych edytorów <a href="/wiki/Pomoc:Pierwsze_kroki" aria-label="Dowiedz się więcej na temat edytowania"><span>dowiedz się więcej</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Specjalna:M%C3%B3j_wk%C5%82ad" title="Lista edycji wykonanych z tego adresu IP [y]" accesskey="y"><span>Edycje</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Specjalna:Moja_dyskusja" title="Dyskusja użytkownika dla tego adresu IP [n]" accesskey="n"><span>Dyskusja</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Witryna"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Spis treści" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Spis treści</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">przypnij</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">ukryj</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Początek</div> </a> </li> <li id="toc-Wyrażenie_regularne_w_informatyce_teoretycznej" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Wyrażenie_regularne_w_informatyce_teoretycznej"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Wyrażenie regularne w informatyce teoretycznej</span> </div> </a> <button aria-controls="toc-Wyrażenie_regularne_w_informatyce_teoretycznej-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Przełącz podsekcję Wyrażenie regularne w informatyce teoretycznej</span> </button> <ul id="toc-Wyrażenie_regularne_w_informatyce_teoretycznej-sublist" class="vector-toc-list"> <li id="toc-Definicja_wyrażeń_regularnych" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Definicja_wyrażeń_regularnych"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.1</span> <span>Definicja wyrażeń regularnych</span> </div> </a> <ul id="toc-Definicja_wyrażeń_regularnych-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Definicja_języka_określanego_przez_wyrażenie_regularne" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Definicja_języka_określanego_przez_wyrażenie_regularne"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2</span> <span>Definicja języka określanego przez wyrażenie regularne</span> </div> </a> <ul id="toc-Definicja_języka_określanego_przez_wyrażenie_regularne-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Własności_wyrażeń_regularnych" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Własności_wyrażeń_regularnych"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.3</span> <span>Własności wyrażeń regularnych</span> </div> </a> <ul id="toc-Własności_wyrażeń_regularnych-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Wyrażenia_regularne_a_automaty_skończone" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Wyrażenia_regularne_a_automaty_skończone"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.4</span> <span>Wyrażenia regularne a automaty skończone</span> </div> </a> <ul id="toc-Wyrażenia_regularne_a_automaty_skończone-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Wyrażenia_regularne_w_praktyce" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Wyrażenia_regularne_w_praktyce"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Wyrażenia regularne w praktyce</span> </div> </a> <button aria-controls="toc-Wyrażenia_regularne_w_praktyce-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Przełącz podsekcję Wyrażenia regularne w praktyce</span> </button> <ul id="toc-Wyrażenia_regularne_w_praktyce-sublist" class="vector-toc-list"> <li id="toc-Porównanie_składni_praktycznej_z_teoretyczną" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Porównanie_składni_praktycznej_z_teoretyczną"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>Porównanie składni praktycznej z teoretyczną</span> </div> </a> <ul id="toc-Porównanie_składni_praktycznej_z_teoretyczną-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Podstawowe_elementy" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Podstawowe_elementy"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>Podstawowe elementy</span> </div> </a> <ul id="toc-Podstawowe_elementy-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Rozszerzenia_Perla" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Rozszerzenia_Perla"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3</span> <span>Rozszerzenia Perla</span> </div> </a> <ul id="toc-Rozszerzenia_Perla-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Wyrażenia_zachłanne" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Wyrażenia_zachłanne"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.4</span> <span>Wyrażenia zachłanne</span> </div> </a> <ul id="toc-Wyrażenia_zachłanne-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Wady_wyrażeń_regularnych" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Wady_wyrażeń_regularnych"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.5</span> <span>Wady wyrażeń regularnych</span> </div> </a> <ul id="toc-Wady_wyrażeń_regularnych-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Zobacz_też" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Zobacz_też"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Zobacz też</span> </div> </a> <ul id="toc-Zobacz_też-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Przypisy" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Przypisy"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Przypisy</span> </div> </a> <ul id="toc-Przypisy-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Bibliografia" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Bibliografia"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Bibliografia</span> </div> </a> <ul id="toc-Bibliografia-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Linki_zewnętrzne" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Linki_zewnętrzne"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Linki zewnętrzne</span> </div> </a> <ul id="toc-Linki_zewnętrzne-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Spis treści" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" title="Spis treści" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Przełącz stan spisu treści" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Przełącz stan spisu treści</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Wyrażenie regularne</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Przejdź do artykułu w innym języku. Treść dostępna w 58 językach" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-58" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">58 języków</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-af mw-list-item"><a href="https://af.wikipedia.org/wiki/Regul%C3%AAre_uitdrukking" title="Regulêre uitdrukking – afrikaans" lang="af" hreflang="af" data-title="Regulêre uitdrukking" data-language-autonym="Afrikaans" data-language-local-name="afrikaans" class="interlanguage-link-target"><span>Afrikaans</span></a></li><li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D8%AA%D8%B9%D8%A8%D9%8A%D8%B1_%D9%86%D9%85%D8%B7%D9%8A" title="تعبير نمطي – arabski" lang="ar" hreflang="ar" data-title="تعبير نمطي" data-language-autonym="العربية" data-language-local-name="arabski" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-az mw-list-item"><a href="https://az.wikipedia.org/wiki/Requlyar_ifad%C9%99" title="Requlyar ifadə – azerbejdżański" lang="az" hreflang="az" data-title="Requlyar ifadə" data-language-autonym="Azərbaycanca" data-language-local-name="azerbejdżański" class="interlanguage-link-target"><span>Azərbaycanca</span></a></li><li class="interlanguage-link interwiki-bn mw-list-item"><a href="https://bn.wikipedia.org/wiki/%E0%A6%B0%E0%A7%87%E0%A6%97%E0%A7%81%E0%A6%B2%E0%A6%BE%E0%A6%B0_%E0%A6%8F%E0%A6%95%E0%A7%8D%E0%A6%B8%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A7%87%E0%A6%B6%E0%A6%A8" title="রেগুলার এক্সপ্রেশন – bengalski" lang="bn" hreflang="bn" data-title="রেগুলার এক্সপ্রেশন" data-language-autonym="বাংলা" data-language-local-name="bengalski" class="interlanguage-link-target"><span>বাংলা</span></a></li><li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://bg.wikipedia.org/wiki/%D0%A0%D0%B5%D0%B3%D1%83%D0%BB%D1%8F%D1%80%D0%B5%D0%BD_%D0%B8%D0%B7%D1%80%D0%B0%D0%B7" title="Регулярен израз – bułgarski" lang="bg" hreflang="bg" data-title="Регулярен израз" data-language-autonym="Български" data-language-local-name="bułgarski" class="interlanguage-link-target"><span>Български</span></a></li><li class="interlanguage-link interwiki-bar mw-list-item"><a href="https://bar.wikipedia.org/wiki/Regex" title="Regex – bawarski" lang="bar" hreflang="bar" data-title="Regex" data-language-autonym="Boarisch" data-language-local-name="bawarski" class="interlanguage-link-target"><span>Boarisch</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/Expressi%C3%B3_regular" title="Expressió regular – kataloński" lang="ca" hreflang="ca" data-title="Expressió regular" data-language-autonym="Català" data-language-local-name="kataloński" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/Regul%C3%A1rn%C3%AD_v%C3%BDraz" title="Regulární výraz – czeski" lang="cs" hreflang="cs" data-title="Regulární výraz" data-language-autonym="Čeština" data-language-local-name="czeski" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/Regul%C3%A6rt_udtryk" title="Regulært udtryk – duński" lang="da" hreflang="da" data-title="Regulært udtryk" data-language-autonym="Dansk" data-language-local-name="duński" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck" title="Regulärer Ausdruck – niemiecki" lang="de" hreflang="de" data-title="Regulärer Ausdruck" data-language-autonym="Deutsch" data-language-local-name="niemiecki" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-et mw-list-item"><a href="https://et.wikipedia.org/wiki/Regulaaravaldis" title="Regulaaravaldis – estoński" lang="et" hreflang="et" data-title="Regulaaravaldis" data-language-autonym="Eesti" data-language-local-name="estoński" class="interlanguage-link-target"><span>Eesti</span></a></li><li class="interlanguage-link interwiki-el mw-list-item"><a href="https://el.wikipedia.org/wiki/%CE%9A%CE%B1%CE%BD%CE%BF%CE%BD%CE%B9%CE%BA%CE%AE_%CE%AD%CE%BA%CF%86%CF%81%CE%B1%CF%83%CE%B7" title="Κανονική έκφραση – grecki" lang="el" hreflang="el" data-title="Κανονική έκφραση" data-language-autonym="Ελληνικά" data-language-local-name="grecki" class="interlanguage-link-target"><span>Ελληνικά</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/Regular_expression" title="Regular expression – angielski" lang="en" hreflang="en" data-title="Regular expression" data-language-autonym="English" data-language-local-name="angielski" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Expresi%C3%B3n_regular" title="Expresión regular – hiszpański" lang="es" hreflang="es" data-title="Expresión regular" data-language-autonym="Español" data-language-local-name="hiszpański" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-eo mw-list-item"><a href="https://eo.wikipedia.org/wiki/Regula_esprimo" title="Regula esprimo – esperanto" lang="eo" hreflang="eo" data-title="Regula esprimo" data-language-autonym="Esperanto" data-language-local-name="esperanto" class="interlanguage-link-target"><span>Esperanto</span></a></li><li class="interlanguage-link interwiki-eu mw-list-item"><a href="https://eu.wikipedia.org/wiki/Adierazpen_erregular" title="Adierazpen erregular – baskijski" lang="eu" hreflang="eu" data-title="Adierazpen erregular" data-language-autonym="Euskara" data-language-local-name="baskijski" class="interlanguage-link-target"><span>Euskara</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D8%B9%D8%A8%D8%A7%D8%B1%D8%AA_%D8%A8%D8%A7%D9%82%D8%A7%D8%B9%D8%AF%D9%87" title="عبارت باقاعده – perski" lang="fa" hreflang="fa" data-title="عبارت باقاعده" data-language-autonym="فارسی" data-language-local-name="perski" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Expression_r%C3%A9guli%C3%A8re" title="Expression régulière – francuski" lang="fr" hreflang="fr" data-title="Expression régulière" data-language-autonym="Français" data-language-local-name="francuski" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-gl mw-list-item"><a href="https://gl.wikipedia.org/wiki/Expresi%C3%B3n_regular" title="Expresión regular – galicyjski" lang="gl" hreflang="gl" data-title="Expresión regular" data-language-autonym="Galego" data-language-local-name="galicyjski" class="interlanguage-link-target"><span>Galego</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EC%A0%95%EA%B7%9C_%ED%91%9C%ED%98%84%EC%8B%9D" title="정규 표현식 – koreański" lang="ko" hreflang="ko" data-title="정규 표현식" data-language-autonym="한국어" data-language-local-name="koreański" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-hy mw-list-item"><a href="https://hy.wikipedia.org/wiki/%D4%BF%D5%A1%D5%B6%D5%B8%D5%B6%D5%A1%D5%BE%D5%B8%D6%80_%D5%A1%D6%80%D5%BF%D5%A1%D5%B0%D5%A1%D5%B5%D5%BF%D5%B8%D6%82%D5%A9%D5%B5%D5%B8%D6%82%D5%B6%D5%B6%D5%A5%D6%80" title="Կանոնավոր արտահայտություններ – ormiański" lang="hy" hreflang="hy" data-title="Կանոնավոր արտահայտություններ" data-language-autonym="Հայերեն" data-language-local-name="ormiański" class="interlanguage-link-target"><span>Հայերեն</span></a></li><li class="interlanguage-link interwiki-hi mw-list-item"><a href="https://hi.wikipedia.org/wiki/%E0%A4%B0%E0%A5%87%E0%A4%97%E0%A5%8D%E0%A4%AF%E0%A5%81%E0%A4%B2%E0%A4%B0_%E0%A4%8D%E0%A4%95%E0%A5%8D%E0%A4%B8%E0%A4%AA%E0%A5%8D%E0%A4%B0%E0%A5%88%E0%A4%B6%E0%A4%A8" title="रेग्युलर ऍक्सप्रैशन – hindi" lang="hi" hreflang="hi" data-title="रेग्युलर ऍक्सप्रैशन" data-language-autonym="हिन्दी" data-language-local-name="hindi" class="interlanguage-link-target"><span>हिन्दी</span></a></li><li class="interlanguage-link interwiki-hr mw-list-item"><a href="https://hr.wikipedia.org/wiki/Regularni_izraz" title="Regularni izraz – chorwacki" lang="hr" hreflang="hr" data-title="Regularni izraz" data-language-autonym="Hrvatski" data-language-local-name="chorwacki" class="interlanguage-link-target"><span>Hrvatski</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/Ekspresi_reguler" title="Ekspresi reguler – indonezyjski" lang="id" hreflang="id" data-title="Ekspresi reguler" data-language-autonym="Bahasa Indonesia" data-language-local-name="indonezyjski" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikipedia.org/wiki/Regluleg_seg%C3%B0" title="Regluleg segð – islandzki" lang="is" hreflang="is" data-title="Regluleg segð" data-language-autonym="Íslenska" data-language-local-name="islandzki" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Espressione_regolare" title="Espressione regolare – włoski" lang="it" hreflang="it" data-title="Espressione regolare" data-language-autonym="Italiano" data-language-local-name="włoski" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/%D7%91%D7%99%D7%98%D7%95%D7%99_%D7%A8%D7%92%D7%95%D7%9C%D7%A8%D7%99" title="ביטוי רגולרי – hebrajski" lang="he" hreflang="he" data-title="ביטוי רגולרי" data-language-autonym="עברית" data-language-local-name="hebrajski" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-ka mw-list-item"><a href="https://ka.wikipedia.org/wiki/%E1%83%A0%E1%83%94%E1%83%92%E1%83%A3%E1%83%9A%E1%83%90%E1%83%A0%E1%83%A3%E1%83%9A%E1%83%98_%E1%83%92%E1%83%90%E1%83%9B%E1%83%9D%E1%83%A1%E1%83%90%E1%83%AE%E1%83%A3%E1%83%9A%E1%83%94%E1%83%91%E1%83%90" title="რეგულარული გამოსახულება – gruziński" lang="ka" hreflang="ka" data-title="რეგულარული გამოსახულება" data-language-autonym="ქართული" data-language-local-name="gruziński" class="interlanguage-link-target"><span>ქართული</span></a></li><li class="interlanguage-link interwiki-ky mw-list-item"><a href="https://ky.wikipedia.org/wiki/%D0%A0%D0%B5%D0%B3%D1%83%D0%BB%D1%8F%D1%80%D0%B4%D1%8B%D0%BA_%D1%82%D1%83%D1%8E%D0%BD%D1%82%D0%BC%D0%B0" title="Регулярдык туюнтма – kirgiski" lang="ky" hreflang="ky" data-title="Регулярдык туюнтма" data-language-autonym="Кыргызча" data-language-local-name="kirgiski" class="interlanguage-link-target"><span>Кыргызча</span></a></li><li class="interlanguage-link interwiki-lv mw-list-item"><a href="https://lv.wikipedia.org/wiki/Regul%C4%81r%C4%81_izteiksme" title="Regulārā izteiksme – łotewski" lang="lv" hreflang="lv" data-title="Regulārā izteiksme" data-language-autonym="Latviešu" data-language-local-name="łotewski" class="interlanguage-link-target"><span>Latviešu</span></a></li><li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://hu.wikipedia.org/wiki/Regul%C3%A1ris_kifejez%C3%A9s" title="Reguláris kifejezés – węgierski" lang="hu" hreflang="hu" data-title="Reguláris kifejezés" data-language-autonym="Magyar" data-language-local-name="węgierski" class="interlanguage-link-target"><span>Magyar</span></a></li><li class="interlanguage-link interwiki-mk mw-list-item"><a href="https://mk.wikipedia.org/wiki/%D0%A0%D0%B5%D0%B3%D1%83%D0%BB%D0%B0%D1%80%D0%B5%D0%BD_%D0%B8%D0%B7%D1%80%D0%B0%D0%B7" title="Регуларен израз – macedoński" lang="mk" hreflang="mk" data-title="Регуларен израз" data-language-autonym="Македонски" data-language-local-name="macedoński" class="interlanguage-link-target"><span>Македонски</span></a></li><li class="interlanguage-link interwiki-ml mw-list-item"><a href="https://ml.wikipedia.org/wiki/%E0%B4%B1%E0%B5%86%E0%B4%97%E0%B5%81%E0%B4%B2%E0%B5%BC_%E0%B4%8E%E0%B4%95%E0%B5%8D%E0%B4%B8%E0%B5%8D%E0%B4%AA%E0%B5%8D%E0%B4%B0%E0%B4%B7%E0%B4%A8%E0%B5%81%E0%B4%95%E0%B5%BE" title="റെഗുലർ എക്സ്പ്രഷനുകൾ – malajalam" lang="ml" hreflang="ml" data-title="റെഗുലർ എക്സ്പ്രഷനുകൾ" data-language-autonym="മലയാളം" data-language-local-name="malajalam" class="interlanguage-link-target"><span>മലയാളം</span></a></li><li class="interlanguage-link interwiki-mwl mw-list-item"><a href="https://mwl.wikipedia.org/wiki/Spresson_Regular" title="Spresson Regular – mirandyjski" lang="mwl" hreflang="mwl" data-title="Spresson Regular" data-language-autonym="Mirandés" data-language-local-name="mirandyjski" class="interlanguage-link-target"><span>Mirandés</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Reguliere_expressie" title="Reguliere expressie – niderlandzki" lang="nl" hreflang="nl" data-title="Reguliere expressie" data-language-autonym="Nederlands" data-language-local-name="niderlandzki" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/%E6%AD%A3%E8%A6%8F%E8%A1%A8%E7%8F%BE" title="正規表現 – japoński" lang="ja" hreflang="ja" data-title="正規表現" data-language-autonym="日本語" data-language-local-name="japoński" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-no mw-list-item"><a href="https://no.wikipedia.org/wiki/Regul%C3%A6rt_uttrykk" title="Regulært uttrykk – norweski (bokmål)" lang="nb" hreflang="nb" data-title="Regulært uttrykk" data-language-autonym="Norsk bokmål" data-language-local-name="norweski (bokmål)" class="interlanguage-link-target"><span>Norsk bokmål</span></a></li><li class="interlanguage-link interwiki-pnb mw-list-item"><a href="https://pnb.wikipedia.org/wiki/%D8%B1%DB%8C%D8%AC%DB%8C%DA%A9%D8%B3" title="ریجیکس – Western Punjabi" lang="pnb" hreflang="pnb" data-title="ریجیکس" data-language-autonym="پنجابی" data-language-local-name="Western Punjabi" class="interlanguage-link-target"><span>پنجابی</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Express%C3%A3o_regular" title="Expressão regular – portugalski" lang="pt" hreflang="pt" data-title="Expressão regular" data-language-autonym="Português" data-language-local-name="portugalski" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://ro.wikipedia.org/wiki/Expresie_regulat%C4%83" title="Expresie regulată – rumuński" lang="ro" hreflang="ro" data-title="Expresie regulată" data-language-autonym="Română" data-language-local-name="rumuński" class="interlanguage-link-target"><span>Română</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%A0%D0%B5%D0%B3%D1%83%D0%BB%D1%8F%D1%80%D0%BD%D1%8B%D0%B5_%D0%B2%D1%8B%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F" title="Регулярные выражения – rosyjski" lang="ru" hreflang="ru" data-title="Регулярные выражения" data-language-autonym="Русский" data-language-local-name="rosyjski" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sq mw-list-item"><a href="https://sq.wikipedia.org/wiki/Shprehje_e_rregullt" title="Shprehje e rregullt – albański" lang="sq" hreflang="sq" data-title="Shprehje e rregullt" data-language-autonym="Shqip" data-language-local-name="albański" class="interlanguage-link-target"><span>Shqip</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Regular_expression" title="Regular expression – Simple English" lang="en-simple" hreflang="en-simple" data-title="Regular expression" data-language-autonym="Simple English" data-language-local-name="Simple English" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sk mw-list-item"><a href="https://sk.wikipedia.org/wiki/Regul%C3%A1rny_v%C3%BDraz" title="Regulárny výraz – słowacki" lang="sk" hreflang="sk" data-title="Regulárny výraz" data-language-autonym="Slovenčina" data-language-local-name="słowacki" class="interlanguage-link-target"><span>Slovenčina</span></a></li><li class="interlanguage-link interwiki-sl mw-list-item"><a href="https://sl.wikipedia.org/wiki/Regularni_izraz" title="Regularni izraz – słoweński" lang="sl" hreflang="sl" data-title="Regularni izraz" data-language-autonym="Slovenščina" data-language-local-name="słoweński" class="interlanguage-link-target"><span>Slovenščina</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/Regularni_izraz" title="Regularni izraz – serbski" lang="sr" hreflang="sr" data-title="Regularni izraz" data-language-autonym="Српски / srpski" data-language-local-name="serbski" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/S%C3%A4%C3%A4nn%C3%B6llinen_lauseke" title="Säännöllinen lauseke – fiński" lang="fi" hreflang="fi" data-title="Säännöllinen lauseke" data-language-autonym="Suomi" data-language-local-name="fiński" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/Regulj%C3%A4ra_uttryck" title="Reguljära uttryck – szwedzki" lang="sv" hreflang="sv" data-title="Reguljära uttryck" data-language-autonym="Svenska" data-language-local-name="szwedzki" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-ta mw-list-item"><a href="https://ta.wikipedia.org/wiki/%E0%AE%9A%E0%AF%81%E0%AE%B0%E0%AF%81%E0%AE%99%E0%AF%8D%E0%AE%95%E0%AF%81%E0%AE%B1%E0%AE%BF%E0%AE%A4%E0%AF%8D%E0%AE%A4%E0%AF%8A%E0%AE%9F%E0%AE%B0%E0%AF%8D" title="சுருங்குறித்தொடர் – tamilski" lang="ta" hreflang="ta" data-title="சுருங்குறித்தொடர்" data-language-autonym="தமிழ்" data-language-local-name="tamilski" class="interlanguage-link-target"><span>தமிழ்</span></a></li><li class="interlanguage-link interwiki-th mw-list-item"><a href="https://th.wikipedia.org/wiki/%E0%B8%99%E0%B8%B4%E0%B8%9E%E0%B8%88%E0%B8%99%E0%B9%8C%E0%B8%9B%E0%B8%A3%E0%B8%81%E0%B8%95%E0%B8%B4" title="นิพจน์ปรกติ – tajski" lang="th" hreflang="th" data-title="นิพจน์ปรกติ" data-language-autonym="ไทย" data-language-local-name="tajski" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/D%C3%BCzenli_ifade" title="Düzenli ifade – turecki" lang="tr" hreflang="tr" data-title="Düzenli ifade" data-language-autonym="Türkçe" data-language-local-name="turecki" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/%D0%A0%D0%B5%D0%B3%D1%83%D0%BB%D1%8F%D1%80%D0%BD%D0%B8%D0%B9_%D0%B2%D0%B8%D1%80%D0%B0%D0%B7" title="Регулярний вираз – ukraiński" lang="uk" hreflang="uk" data-title="Регулярний вираз" data-language-autonym="Українська" data-language-local-name="ukraiński" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-ur mw-list-item"><a href="https://ur.wikipedia.org/wiki/%D8%B1%DB%8C%D8%AC%DB%8C%DA%A9%D8%B3" title="ریجیکس – urdu" lang="ur" hreflang="ur" data-title="ریجیکس" data-language-autonym="اردو" data-language-local-name="urdu" class="interlanguage-link-target"><span>اردو</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/Bi%E1%BB%83u_th%E1%BB%A9c_ch%C3%ADnh_quy" title="Biểu thức chính quy – wietnamski" lang="vi" hreflang="vi" data-title="Biểu thức chính quy" data-language-autonym="Tiếng Việt" data-language-local-name="wietnamski" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-wa mw-list-item"><a href="https://wa.wikipedia.org/wiki/Er%C3%AEl%C3%AAye_ratourneure" title="Erîlêye ratourneure – waloński" lang="wa" hreflang="wa" data-title="Erîlêye ratourneure" data-language-autonym="Walon" data-language-local-name="waloński" class="interlanguage-link-target"><span>Walon</span></a></li><li class="interlanguage-link interwiki-wuu mw-list-item"><a href="https://wuu.wikipedia.org/wiki/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F" title="正则表达式 – wu" lang="wuu" hreflang="wuu" data-title="正则表达式" data-language-autonym="吴语" data-language-local-name="wu" class="interlanguage-link-target"><span>吴语</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/%E6%AD%A3%E5%89%87%E8%A1%A8%E9%81%94%E5%BC%8F" title="正則表達式 – kantoński" lang="yue" hreflang="yue" data-title="正則表達式" data-language-autonym="粵語" data-language-local-name="kantoński" class="interlanguage-link-target"><span>粵語</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F" title="正则表达式 – chiński" lang="zh" hreflang="zh" data-title="正则表达式" data-language-autonym="中文" data-language-local-name="chiński" class="interlanguage-link-target"><span>中文</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q185612#sitelinks-wikipedia" title="Edytuj linki pomiędzy wersjami językowymi" class="wbc-editpage">Edytuj linki</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Przestrzenie nazw"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Wyra%C5%BCenie_regularne" title="Zobacz stronę treści [c]" accesskey="c"><span>Artykuł</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Dyskusja:Wyra%C5%BCenie_regularne" rel="discussion" title="Dyskusja o zawartości tej strony [t]" accesskey="t"><span>Dyskusja</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Zmień wariant języka" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">polski</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Widok"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Wyra%C5%BCenie_regularne"><span>Czytaj</span></a></li><li id="ca-ve-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit" title="Edytuj tę stronę [v]" accesskey="v"><span>Edytuj</span></a></li><li id="ca-edit" class="collapsible vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit" title="Edycja kodu źródłowego strony [e]" accesskey="e"><span>Edytuj kod źródłowy</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=history" title="Starsze wersje tej strony [h]" accesskey="h"><span>Wyświetl historię</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Narzędzia dla stron"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Narzędzia" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Narzędzia</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Narzędzia</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">przypnij</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">ukryj</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Więcej opcji" > <div class="vector-menu-heading"> Działania </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Wyra%C5%BCenie_regularne"><span>Czytaj</span></a></li><li id="ca-more-ve-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit" title="Edytuj tę stronę [v]" accesskey="v"><span>Edytuj</span></a></li><li id="ca-more-edit" class="collapsible vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit" title="Edycja kodu źródłowego strony [e]" accesskey="e"><span>Edytuj kod źródłowy</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=history"><span>Wyświetl historię</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> Ogólne </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Specjalna:Linkuj%C4%85ce/Wyra%C5%BCenie_regularne" title="Pokaż listę wszystkich stron linkujących do tej strony [j]" accesskey="j"><span>Linkujące</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Specjalna:Zmiany_w_linkowanych/Wyra%C5%BCenie_regularne" rel="nofollow" title="Ostatnie zmiany w stronach, do których ta strona linkuje [k]" accesskey="k"><span>Zmiany w linkowanych</span></a></li><li id="t-upload" class="mw-list-item"><a href="//pl.wikipedia.org/wiki/Wikipedia:Prześlij_plik" title="Prześlij pliki [u]" accesskey="u"><span>Prześlij plik</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;oldid=75388257" title="Stały link do tej wersji tej strony"><span>Link do tej wersji</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=info" title="Więcej informacji na temat tej strony"><span>Informacje o tej stronie</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Specjalna:Cytuj&amp;page=Wyra%C5%BCenie_regularne&amp;id=75388257&amp;wpFormIdentifier=titleform" title="Informacja o tym jak należy cytować tę stronę"><span>Cytowanie tego artykułu</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Specjalna:Skr%C3%B3%C4%87_adres_URL&amp;url=https%3A%2F%2Fpl.wikipedia.org%2Fwiki%2FWyra%25C5%25BCenie_regularne"><span>Zobacz skrócony adres URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Specjalna:Kod_QR&amp;url=https%3A%2F%2Fpl.wikipedia.org%2Fwiki%2FWyra%25C5%25BCenie_regularne"><span>Pobierz kod QR</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Drukuj lub eksportuj </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Specjalna:Ksi%C4%85%C5%BCka&amp;bookcmd=book_creator&amp;referer=Wyra%C5%BCenie+regularne"><span>Utwórz książkę</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Specjalna:DownloadAsPdf&amp;page=Wyra%C5%BCenie_regularne&amp;action=show-download-screen"><span>Pobierz jako PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;printable=yes" title="Wersja do wydruku [p]" accesskey="p"><span>Wersja do druku</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> W innych projektach </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Category:Regex" hreflang="en"><span>Wikimedia Commons</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q185612" title="Link do powiązanego elementu w repozytorium danych [g]" accesskey="g"><span>Element Wikidanych</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Narzędzia dla stron"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Wygląd"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Wygląd</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">przypnij</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">ukryj</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">Z Wikipedii, wolnej encyklopedii</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="pl" dir="ltr"><p><b>Wyrażenie regularne</b> (<a href="/wiki/J%C4%99zyk_angielski" title="Język angielski">ang.</a>&#160;<em lang="en">regular expression</em>, w skrócie <em lang="en">regex</em> lub <em lang="en">regexp</em>) – wzorzec opisujący łańcuch <a href="/wiki/Symbol" title="Symbol">symboli</a>. Teoria wyrażeń regularnych jest związana z teorią <a href="/wiki/J%C4%99zyk_regularny" title="Język regularny">języków regularnych</a>. Wyrażenia regularne mogą określać <a href="/wiki/Zbi%C3%B3r" title="Zbiór">zbiór</a> pasujących łańcuchów, jak również wyszczególniać istotne części łańcucha. </p><p>W informatyce teoretycznej wyrażenia regularne są ciągami znaków pozwalającymi opisywać języki regularne. W praktyce znalazły bardzo szerokie zastosowanie, pozwalają bowiem w łatwy sposób opisywać wzorce tekstu, natomiast istniejące <a href="/wiki/Algorytm" title="Algorytm">algorytmy</a> w efektywny sposób określają, czy podany ciąg znaków pasuje do wzorca lub wyszukują w tekście wystąpienia wzorca. Wyrażenia regularne w praktycznych zastosowaniach są zapisywane za pomocą bogatszej i łatwiejszej w użyciu składni niż ta stosowana w rozważaniach teoretycznych. Co więcej, opisane niżej powszechnie wykorzystywane wsteczne referencje (czyli użycie wcześniej dopasowanego fragmentu tekstu jako części wzorca), powodują, że wyrażenie regularne je zawierające może nie definiować języka regularnego. </p><p>Wyrażenia regularne stanowią integralną część narzędzi systemowych takich jak <a href="/wiki/Sed_(program)" title="Sed (program)">sed</a>, <a href="/wiki/Grep" title="Grep">grep</a>, wielu <a href="/wiki/Edytor_tekstu" title="Edytor tekstu">edytorów tekstu</a>, <a href="/wiki/J%C4%99zyk_programowania" title="Język programowania">języków programowania</a> przetwarzających tekst <a href="/wiki/AWK" title="AWK">AWK</a> i <a href="/wiki/Perl" title="Perl">Perl</a>, a także są dostępne jako odrębne <a href="/wiki/Biblioteka_programistyczna" title="Biblioteka programistyczna">biblioteki</a> dla wszystkich języków używanych obecnie. </p><p>Dwie najpopularniejsze składnie wyrażeń regularnych to składnia <a href="/wiki/Unix" title="Unix">uniksowa</a> i składnia <a href="/wiki/Perl" title="Perl">perlowa</a>. Składnia perlowa jest znacznie bardziej rozbudowana. Jest ona używana nie tylko w języku <a href="/wiki/Perl" title="Perl">Perl</a>, ale także w innych <a href="/wiki/J%C4%99zyk_programowania" title="Język programowania">językach programowania</a>: <a href="/wiki/Ruby_(j%C4%99zyk_programowania)" title="Ruby (język programowania)">Ruby</a>, bibliotece <a href="/wiki/PCRE" title="PCRE">PCRE</a> do <a href="/wiki/C_(j%C4%99zyk_programowania)" title="C (język programowania)">C</a> i w narzędziu powłoki o nazwie <a href="/w/index.php?title=Pcregrep&amp;action=edit&amp;redlink=1" class="new" title="Pcregrep (strona nie istnieje)">pcregrep</a> (znanego też jako pgrep). Perlową składnię stosuje się również w maskach przepisań <a href="/wiki/Przekierowanie_URL" title="Przekierowanie URL">mod rewrite</a>. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Wyrażenie_regularne_w_informatyce_teoretycznej"><span id="Wyra.C5.BCenie_regularne_w_informatyce_teoretycznej"></span>Wyrażenie regularne w informatyce teoretycznej</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=1" title="Edytuj sekcję: Wyrażenie regularne w informatyce teoretycznej" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=1" title="Edytuj kod źródłowy sekcji: Wyrażenie regularne w informatyce teoretycznej"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Definicja_wyrażeń_regularnych"><span id="Definicja_wyra.C5.BCe.C5.84_regularnych"></span>Definicja wyrażeń regularnych</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=2" title="Edytuj sekcję: Definicja wyrażeń regularnych" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=2" title="Edytuj kod źródłowy sekcji: Definicja wyrażeń regularnych"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Wyrażeniem regularnym nad alfabetem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Sigma }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal">&#x3a3;<!-- Σ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Sigma }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9e1f558f53cda207614abdf90162266c70bc5c1e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \Sigma }" /></span> nazywamy ciąg znaków składający się z symboli <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \varnothing ,\ \epsilon ,\ +,\ {\text{*}},\ ),\ (}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi class="MJX-variant">&#x2205;<!-- ∅ --></mi> <mo>,</mo> <mtext>&#xa0;</mtext> <mi>&#x3f5;<!-- ϵ --></mi> <mo>,</mo> <mtext>&#xa0;</mtext> <mo>+</mo> <mo>,</mo> <mtext>&#xa0;</mtext> <mrow class="MJX-TeXAtom-ORD"> <mtext>*</mtext> </mrow> <mo>,</mo> <mtext>&#xa0;</mtext> <mo stretchy="false">)</mo> <mo>,</mo> <mtext>&#xa0;</mtext> <mo stretchy="false">(</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \varnothing ,\ \epsilon ,\ +,\ {\text{*}},\ ),\ (}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1c2a278477e39a9452fc6ff3a556b4d6178f0dae" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:15.605ex; height:2.843ex;" alt="{\displaystyle \varnothing ,\ \epsilon ,\ +,\ {\text{*}},\ ),\ (}" /></span> oraz symboli <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{i}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle a_{i}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0bc77764b2e74e64a63341054fa90f3e07db275f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.029ex; height:2.009ex;" alt="{\displaystyle a_{i}}" /></span> z alfabetu <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Sigma }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal">&#x3a3;<!-- Σ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Sigma }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9e1f558f53cda207614abdf90162266c70bc5c1e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \Sigma }" /></span> następującej postaci: </p> <ol><li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \varnothing ,\epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi class="MJX-variant">&#x2205;<!-- ∅ --></mi> <mo>,</mo> <mi>&#x3f5;<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \varnothing ,\epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5f82634f7dd5a90d3b4038f3ab1e6c94749495ff" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.786ex; height:2.343ex;" alt="{\displaystyle \varnothing ,\epsilon }" /></span> (słowo puste) są wyrażeniami regularnymi;</li> <li>wszystkie symbole <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a_{i}\in \Sigma }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo>&#x2208;<!-- ∈ --></mo> <mi mathvariant="normal">&#x3a3;<!-- Σ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle a_{i}\in \Sigma }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e3f1c6c0f8a04519e74495f4608d01ddf3c92e74" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.548ex; height:2.509ex;" alt="{\displaystyle a_{i}\in \Sigma }" /></span> są wyrażeniami regularnymi;</li> <li>jeśli <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1},e_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1},e_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/27745534114fb1b24bed92a798254b53bcd0f63b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:5.309ex; height:2.009ex;" alt="{\displaystyle e_{1},e_{2}}" /></span> są wyrażeniami regularnymi, to są nimi również: <ul><li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msubsup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msubsup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/605d1e800a1b94749c563edaf7f47110d970e890" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.138ex; height:2.843ex;" alt="{\displaystyle e_{1}^{*}}" /></span> (<a href="/wiki/Domkni%C4%99cie_Kleene%E2%80%99ego" title="Domknięcie Kleene’ego">domknięcie Kleene’ego</a>)</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}e_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}e_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/67031cc07998998972211e4cc6cd417050b4a3f7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.275ex; height:2.009ex;" alt="{\displaystyle e_{1}e_{2}}" /></span> (konkatenacja)</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}+e_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}+e_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1bcb4d1036f77643f73de1cd0bff7ea5496afd9b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.116ex; height:2.343ex;" alt="{\displaystyle e_{1}+e_{2}}" /></span> (suma)</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (e_{1})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (e_{1})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cbdd92166e9f60ae252184029dced23f9b053a30" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:3.947ex; height:2.843ex;" alt="{\displaystyle (e_{1})}" /></span> (grupowanie)</li></ul></li> <li>wszystkie wyrażenia regularne są postaci opisanej w punktach 1–3.</li></ol> <p>Każde wyrażenie regularne definiuje pewien <a href="/wiki/J%C4%99zyk_formalny" title="Język formalny">język formalny</a>. Każdy język definiowany przez wyrażenie regularne jest <a href="/wiki/J%C4%99zyk_regularny" title="Język regularny">regularny</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Definicja_języka_określanego_przez_wyrażenie_regularne"><span id="Definicja_j.C4.99zyka_okre.C5.9Blanego_przez_wyra.C5.BCenie_regularne"></span>Definicja języka określanego przez wyrażenie regularne</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=3" title="Edytuj sekcję: Definicja języka określanego przez wyrażenie regularne" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=3" title="Edytuj kod źródłowy sekcji: Definicja języka określanego przez wyrażenie regularne"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Język definiowany przez wyrażenie regularne jest definiowany indukcyjnie. Niech <span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">L</span>(<span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">w</span>) oznacza język definiowany przez <span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">w</span>. Wtedy baza indukcji jest następująca: </p> <ul><li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(\epsilon )=\{\epsilon \}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi>&#x3f5;<!-- ϵ --></mi> <mo stretchy="false">)</mo> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mi>&#x3f5;<!-- ϵ --></mi> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(\epsilon )=\{\epsilon \}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ada553b9d5a01ee48a8c75f70d8d4c17922eab81" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.704ex; height:2.843ex;" alt="{\displaystyle L(\epsilon )=\{\epsilon \}}" /></span> (zbiór zawierający tylko słowo puste)</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(\varnothing )=\varnothing }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi class="MJX-variant">&#x2205;<!-- ∅ --></mi> <mo stretchy="false">)</mo> <mo>=</mo> <mi class="MJX-variant">&#x2205;<!-- ∅ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(\varnothing )=\varnothing }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/233d58525a46a9f856cdedb0bf6408a7e4578bb5" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.107ex; height:2.843ex;" alt="{\displaystyle L(\varnothing )=\varnothing }" /></span> (<a href="/wiki/Zbi%C3%B3r_pusty" title="Zbiór pusty">zbiór pusty</a>)</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(a)=\{a\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi>a</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mi>a</mi> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(a)=\{a\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/417dfdf1bea17c29748e4b4b7376eb1c158ad6b2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.275ex; height:2.843ex;" alt="{\displaystyle L(a)=\{a\}}" /></span> dla dowolnego <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>a</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle a}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ffd2487510aa438433a2579450ab2b3d557e5edc" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.23ex; height:1.676ex;" alt="{\displaystyle a}" /></span> z alfabetu</li></ul> <p>Natomiast do konstrukcji wyrażeń służą 3 symbole: </p> <ul><li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(w+v)=L(w)\cup L(v)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo>+</mo> <mi>v</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mi>L</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> <mo>&#x222a;<!-- ∪ --></mo> <mi>L</mi> <mo stretchy="false">(</mo> <mi>v</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(w+v)=L(w)\cup L(v)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/959ff8a99deba80384f008a7e7090abb01269039" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:24.281ex; height:2.843ex;" alt="{\displaystyle L(w+v)=L(w)\cup L(v)}" /></span> (<a href="/wiki/Suma_zbior%C3%B3w" title="Suma zbiorów">suma języków</a>)</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(w^{*})=(L(w))^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <msup> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> <mo stretchy="false">)</mo> <mo>=</mo> <mo stretchy="false">(</mo> <mi>L</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> <msup> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(w^{*})=(L(w))^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/56b9f690fd18343e4de2e4f761cfbf8f3d529ae1" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:17.129ex; height:2.843ex;" alt="{\displaystyle L(w^{*})=(L(w))^{*}}" /></span> (domknięcie Kleene’ego)</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(wv)=\{xy:x\in L(w)\wedge y\in L(v)\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mi>v</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mi>x</mi> <mi>y</mi> <mo>:</mo> <mi>x</mi> <mo>&#x2208;<!-- ∈ --></mo> <mi>L</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> <mo>&#x2227;<!-- ∧ --></mo> <mi>y</mi> <mo>&#x2208;<!-- ∈ --></mo> <mi>L</mi> <mo stretchy="false">(</mo> <mi>v</mi> <mo stretchy="false">)</mo> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(wv)=\{xy:x\in L(w)\wedge y\in L(v)\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/234c6fb520e5cd360b81b1bc6896026a00268aac" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:36.355ex; height:2.843ex;" alt="{\displaystyle L(wv)=\{xy:x\in L(w)\wedge y\in L(v)\}}" /></span> (<a href="/wiki/Konkatenacja" title="Konkatenacja">konkatenacja języków</a>)</li></ul> <p>Gwiazdka wiąże najsilniej, konkatenacja słabiej, suma najsłabiej. </p> <div class="mw-heading mw-heading3"><h3 id="Własności_wyrażeń_regularnych"><span id="W.C5.82asno.C5.9Bci_wyra.C5.BCe.C5.84_regularnych"></span>Własności wyrażeń regularnych</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=4" title="Edytuj sekcję: Własności wyrażeń regularnych" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=4" title="Edytuj kod źródłowy sekcji: Własności wyrażeń regularnych"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Wyrażenia są równoważne gdy definiują ten sam język: <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}=e_{2}\iff L(e_{1})=L(e_{2})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>=</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mspace width="thickmathspace"></mspace> <mo stretchy="false">&#x27fa;<!-- ⟺ --></mo> <mspace width="thickmathspace"></mspace> <mi>L</mi> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo stretchy="false">)</mo> <mo>=</mo> <mi>L</mi> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}=e_{2}\iff L(e_{1})=L(e_{2})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cbb2f39a8c0c19d20aa760e619709d3729ca2870" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:28.429ex; height:2.843ex;" alt="{\displaystyle e_{1}=e_{2}\iff L(e_{1})=L(e_{2})}" /></span> </p> <ul><li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e+e=e}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>e</mi> <mo>+</mo> <mi>e</mi> <mo>=</mo> <mi>e</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e+e=e}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/27b929a80c7238e9be1cbfacfd7fc04aaf1c50da" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:9.189ex; height:2.176ex;" alt="{\displaystyle e+e=e}" /></span></li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}+e_{2}=e_{2}+e_{1}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>=</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}+e_{2}=e_{2}+e_{1}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bcb5034b5b791e671219634693b321137e825a96" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:17.33ex; height:2.343ex;" alt="{\displaystyle e_{1}+e_{2}=e_{2}+e_{1}}" /></span> – suma jest <a href="/wiki/Przemienno%C5%9B%C4%87" title="Przemienność">przemienna</a></li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon e=e\epsilon =e}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>&#x3f5;<!-- ϵ --></mi> <mi>e</mi> <mo>=</mo> <mi>e</mi> <mi>&#x3f5;<!-- ϵ --></mi> <mo>=</mo> <mi>e</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon e=e\epsilon =e}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4bee984d94f92577d6b8ebff471f7866b2a6aeb3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:11.336ex; height:1.676ex;" alt="{\displaystyle \epsilon e=e\epsilon =e}" /></span> – łańcuch pusty jest <a href="/wiki/Element_neutralny" title="Element neutralny">elementem neutralnym</a> konkatenacji</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (e_{1}+e_{2})+e_{3}=e_{1}+(e_{2}+e_{3})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo stretchy="false">)</mo> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo>=</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (e_{1}+e_{2})+e_{3}=e_{1}+(e_{2}+e_{3})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ac98b51a572ca908be93e5f5e0eb40c463549676" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:30.905ex; height:2.843ex;" alt="{\displaystyle (e_{1}+e_{2})+e_{3}=e_{1}+(e_{2}+e_{3})}" /></span> – suma jest <a href="/wiki/%C5%81%C4%85czno%C5%9B%C4%87_(matematyka)" title="Łączność (matematyka)">łączna</a></li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (e_{1}e_{2})e_{3}=e_{1}(e_{2}e_{3})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo stretchy="false">)</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo>=</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (e_{1}e_{2})e_{3}=e_{1}(e_{2}e_{3})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2208462434d5cabd809f6db382b2168b5d53ed6b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:19.543ex; height:2.843ex;" alt="{\displaystyle (e_{1}e_{2})e_{3}=e_{1}(e_{2}e_{3})}" /></span> – konkatenacja również jest łączna</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (e_{1}+e_{2})X=e_{1}X+e_{2}X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo stretchy="false">)</mo> <mi>X</mi> <mo>=</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mi>X</mi> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (e_{1}+e_{2})X=e_{1}X+e_{2}X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c4f8377beec10b60a475aab92f339d3d6a734653" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:25.079ex; height:2.843ex;" alt="{\displaystyle (e_{1}+e_{2})X=e_{1}X+e_{2}X}" /></span> – konkatenacja jest <a href="/wiki/Rozdzielno%C5%9B%C4%87" title="Rozdzielność">rozdzielna</a> względem sumy</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X(e_{1}+e_{2})=Xe_{1}+Xe_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> <mo stretchy="false">(</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo stretchy="false">)</mo> <mo>=</mo> <mi>X</mi> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <mi>X</mi> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X(e_{1}+e_{2})=Xe_{1}+Xe_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/98f16d951f1c2b4b2a1b0a6a461444b572c98ad2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:25.079ex; height:2.843ex;" alt="{\displaystyle X(e_{1}+e_{2})=Xe_{1}+Xe_{2}}" /></span></li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e^{*}e=ee^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> <mi>e</mi> <mo>=</mo> <mi>e</mi> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e^{*}e=ee^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5ef1a4728baba947857d8b2139fcc971922fb000" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:9.541ex; height:2.343ex;" alt="{\displaystyle e^{*}e=ee^{*}}" /></span></li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (e^{*})^{*}=e^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> <msup> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> <mo>=</mo> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (e^{*})^{*}=e^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5e7c79c1ae0b2c6a973a17b70a362566b790f7fa" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.237ex; height:2.843ex;" alt="{\displaystyle (e^{*})^{*}=e^{*}}" /></span> – domknięcie Kleene’ego jest <a href="/wiki/Idempotentno%C5%9B%C4%87" title="Idempotentność">idempotentne</a></li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e^{*}e^{*}=e^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> <mo>=</mo> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e^{*}e^{*}=e^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/054f09c6246f4cafb69bed1c9100c97d0cefa6b9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:9.512ex; height:2.343ex;" alt="{\displaystyle e^{*}e^{*}=e^{*}}" /></span></li></ul> <dl><dt>Przykład 1</dt></dl> <p>Wyjaśnienie reguł: </p> <ul><li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msubsup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msubsup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/605d1e800a1b94749c563edaf7f47110d970e890" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.138ex; height:2.843ex;" alt="{\displaystyle e_{1}^{*}}" /></span> – dowolny ciąg składający się z <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/54f842d4b9c9c9f185f3d4c816b73e1bd88a0ace" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.785ex; height:2.009ex;" alt="{\displaystyle e_{1},}" /></span> np. <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}e_{1},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}e_{1},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bd9d285f1986cca4eba35480278c564f6386bb2c" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.922ex; height:2.009ex;" alt="{\displaystyle e_{1}e_{1},}" /></span> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}e_{1}e_{1}e_{1},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}e_{1}e_{1}e_{1},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6738dcf92a01bbb10a761d1c69424dec8a373b88" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:9.198ex; height:2.009ex;" alt="{\displaystyle e_{1}e_{1}e_{1}e_{1},}" /></span> a także pusty</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}e_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}e_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/67031cc07998998972211e4cc6cd417050b4a3f7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.275ex; height:2.009ex;" alt="{\displaystyle e_{1}e_{2}}" /></span> – sekwencja, najpierw <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/54f842d4b9c9c9f185f3d4c816b73e1bd88a0ace" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.785ex; height:2.009ex;" alt="{\displaystyle e_{1},}" /></span> następnie <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4045b5c7cee9bd0681153bbb077489b13269355e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.138ex; height:2.009ex;" alt="{\displaystyle e_{2}}" /></span></li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1}+e_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1}+e_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1bcb4d1036f77643f73de1cd0bff7ea5496afd9b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.116ex; height:2.343ex;" alt="{\displaystyle e_{1}+e_{2}}" /></span> – alternatywa, albo <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{1},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{1},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/54f842d4b9c9c9f185f3d4c816b73e1bd88a0ace" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.785ex; height:2.009ex;" alt="{\displaystyle e_{1},}" /></span> albo <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4045b5c7cee9bd0681153bbb077489b13269355e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.138ex; height:2.009ex;" alt="{\displaystyle e_{2}}" /></span></li></ul> <dl><dt>Przykład 2</dt></dl> <p>Wyrażenie <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (W+w)iki}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <mi>W</mi> <mo>+</mo> <mi>w</mi> <mo stretchy="false">)</mo> <mi>i</mi> <mi>k</mi> <mi>i</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (W+w)iki}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/86ef406f4df7fe70486b10fbf04aef8336c90006" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.565ex; height:2.843ex;" alt="{\displaystyle (W+w)iki}" /></span> definiuje język zawierający dokładnie dwa słowa: „Wiki” i „wiki”. To samo można wyrazić wprost <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Wiki+wiki.}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>W</mi> <mi>i</mi> <mi>k</mi> <mi>i</mi> <mo>+</mo> <mi>w</mi> <mi>i</mi> <mi>k</mi> <mi>i</mi> <mo>.</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle Wiki+wiki.}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3173d1d4ed3f9da08280b40f6080f19d9cf0bf49" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:13.219ex; height:2.343ex;" alt="{\displaystyle Wiki+wiki.}" /></span> </p> <dl><dt>Przykład 3</dt></dl> <p>Wyrażenie <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (a+b)^{*}baba(a+b)^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <mi>a</mi> <mo>+</mo> <mi>b</mi> <msup> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> <mi>b</mi> <mi>a</mi> <mi>b</mi> <mi>a</mi> <mo stretchy="false">(</mo> <mi>a</mi> <mo>+</mo> <mi>b</mi> <msup> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (a+b)^{*}baba(a+b)^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b4eaa00795f88453f71a60adb9b20198a3331c08" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:20.317ex; height:2.843ex;" alt="{\displaystyle (a+b)^{*}baba(a+b)^{*}}" /></span> definiuje język wszystkich słów nad alfabetem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{a,b\},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo fence="false" stretchy="false">{</mo> <mi>a</mi> <mo>,</mo> <mi>b</mi> <mo fence="false" stretchy="false">}</mo> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \{a,b\},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/630f3e36a24bd17ada8cad79ac18c91b859e21bb" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.233ex; height:2.843ex;" alt="{\displaystyle \{a,b\},}" /></span> które zawierają <a href="/wiki/Pods%C5%82owo" title="Podsłowo">podsłowo</a> baba. </p> <div class="mw-heading mw-heading3"><h3 id="Wyrażenia_regularne_a_automaty_skończone"><span id="Wyra.C5.BCenia_regularne_a_automaty_sko.C5.84czone"></span>Wyrażenia regularne a automaty skończone</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=5" title="Edytuj sekcję: Wyrażenia regularne a automaty skończone" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=5" title="Edytuj kod źródłowy sekcji: Wyrażenia regularne a automaty skończone"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="noprint relarticle mainarticle" style="margin:0.2em 0 0.5em 1.6em"><span class="nomobile navigation-not-searchable"><span class="notpageimage" typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Wiki_letter_w.svg/20px-Wiki_letter_w.svg.png" decoding="async" width="20" height="20" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Wiki_letter_w.svg/30px-Wiki_letter_w.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Wiki_letter_w.svg/40px-Wiki_letter_w.svg.png 2x" data-file-width="44" data-file-height="44" /></span></span>&#160;</span><i>Ta sekcja jest niekompletna. Jeśli możesz, <span class="plainlinks"><a class="external text" href="https://pl.wikipedia.org/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit">rozbuduj ją</a></span>.</i></div> <p>Języki regularne można opisać również za pomocą <a href="/wiki/Automat_sko%C5%84czony" title="Automat skończony">automatów skończonych</a>: </p> <ol><li><a href="/wiki/Niedeterministyczny_automat_sko%C5%84czony" title="Niedeterministyczny automat skończony">niedeterministycznego automatu skończonego</a> (NAS) z <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>&#x3f5;<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3837cad72483d97bcdde49c85d3b7b859fb3fd2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }" /></span>-przejściami (automat może zmienić swój stan bez podania symbolu wejściowego),</li> <li>niedeterministycznego automatu skończonego bez <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>&#x3f5;<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3837cad72483d97bcdde49c85d3b7b859fb3fd2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }" /></span>-przejść, oraz</li> <li><a href="/wiki/Deterministyczny_automat_sko%C5%84czony" title="Deterministyczny automat skończony">deterministycznego automatu skończonego</a> (DAS).</li></ol> <table class="wikitable"> <tbody><tr> <th>Automat skończony </th> <th>Wyrażenie regularne </th></tr> <tr> <td align="center"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/Plik:FA_regexp_accept_none.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3a/FA_regexp_accept_none.svg/240px-FA_regexp_accept_none.svg.png" decoding="async" width="240" height="80" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3a/FA_regexp_accept_none.svg/360px-FA_regexp_accept_none.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3a/FA_regexp_accept_none.svg/480px-FA_regexp_accept_none.svg.png 2x" data-file-width="240" data-file-height="80" /></a></span> </td> <td>automat dla pustego języka, nie zawierającego żadnego słowa; <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(\varnothing )=\varnothing }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi class="MJX-variant">&#x2205;<!-- ∅ --></mi> <mo stretchy="false">)</mo> <mo>=</mo> <mi class="MJX-variant">&#x2205;<!-- ∅ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(\varnothing )=\varnothing }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/233d58525a46a9f856cdedb0bf6408a7e4578bb5" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.107ex; height:2.843ex;" alt="{\displaystyle L(\varnothing )=\varnothing }" /></span> </td></tr> <tr> <td align="center"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/Plik:FA_regexp_accept_null.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/2/2b/FA_regexp_accept_null.svg/240px-FA_regexp_accept_null.svg.png" decoding="async" width="240" height="80" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/2/2b/FA_regexp_accept_null.svg/360px-FA_regexp_accept_null.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/2/2b/FA_regexp_accept_null.svg/480px-FA_regexp_accept_null.svg.png 2x" data-file-width="240" data-file-height="80" /></a></span> </td> <td>automat dla języka akceptującego tylko słowo puste; <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(\epsilon )=\{\epsilon \}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi>&#x3f5;<!-- ϵ --></mi> <mo stretchy="false">)</mo> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mi>&#x3f5;<!-- ϵ --></mi> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(\epsilon )=\{\epsilon \}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ada553b9d5a01ee48a8c75f70d8d4c17922eab81" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.704ex; height:2.843ex;" alt="{\displaystyle L(\epsilon )=\{\epsilon \}}" /></span> </td></tr> <tr> <td align="center"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/Plik:FA_regexp_accept_singlesymbol.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/0/08/FA_regexp_accept_singlesymbol.svg/240px-FA_regexp_accept_singlesymbol.svg.png" decoding="async" width="240" height="80" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/0/08/FA_regexp_accept_singlesymbol.svg/360px-FA_regexp_accept_singlesymbol.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/0/08/FA_regexp_accept_singlesymbol.svg/480px-FA_regexp_accept_singlesymbol.svg.png 2x" data-file-width="240" data-file-height="80" /></a></span> </td> <td>automat dla języka akceptującego tylko jeden symbol; <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L(a)=\{a\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo stretchy="false">(</mo> <mi>a</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mi>a</mi> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L(a)=\{a\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/417dfdf1bea17c29748e4b4b7376eb1c158ad6b2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.275ex; height:2.843ex;" alt="{\displaystyle L(a)=\{a\}}" /></span> </td></tr> <tr> <td align="center"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/Plik:NFA_regexp_concat.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/NFA_regexp_concat.svg/440px-NFA_regexp_concat.svg.png" decoding="async" width="440" height="80" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/NFA_regexp_concat.svg/660px-NFA_regexp_concat.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/1/1b/NFA_regexp_concat.svg/880px-NFA_regexp_concat.svg.png 2x" data-file-width="440" data-file-height="80" /></a></span> </td> <td>NAS dla konkatenacji dwóch wyrażeń regularnych: <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha \ \beta }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>&#x3b1;<!-- α --></mi> <mtext>&#xa0;</mtext> <mi>&#x3b2;<!-- β --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \alpha \ \beta }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fa77ec4d6a7c1ea4ec2e0fece9e43a5ceaa4b9eb" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.4ex; height:2.509ex;" alt="{\displaystyle \alpha \ \beta }" /></span> </td></tr> <tr> <td align="center"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/Plik:NFA_regexp_sum.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/5/55/NFA_regexp_sum.svg/370px-NFA_regexp_sum.svg.png" decoding="async" width="370" height="160" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/55/NFA_regexp_sum.svg/555px-NFA_regexp_sum.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/55/NFA_regexp_sum.svg/740px-NFA_regexp_sum.svg.png 2x" data-file-width="370" data-file-height="160" /></a></span> </td> <td>NAS dla sumy dwóch wyrażeń regularnych: <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha +\beta }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>&#x3b1;<!-- α --></mi> <mo>+</mo> <mi>&#x3b2;<!-- β --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \alpha +\beta }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/99b80a3fdecb9cf75091789bb4335a1bb3561b08" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:5.66ex; height:2.509ex;" alt="{\displaystyle \alpha +\beta }" /></span> </td></tr> <tr> <td align="center"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/Plik:NFA_regexp_kleene.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/c/c7/NFA_regexp_kleene.svg/410px-NFA_regexp_kleene.svg.png" decoding="async" width="410" height="170" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/c/c7/NFA_regexp_kleene.svg/615px-NFA_regexp_kleene.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/c/c7/NFA_regexp_kleene.svg/820px-NFA_regexp_kleene.svg.png 2x" data-file-width="410" data-file-height="170" /></a></span> </td> <td>NAS dla domknięcia Kleene’ego wyrażenia regularnego: <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \alpha ^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi>&#x3b1;<!-- α --></mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \alpha ^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/326a86ec82d76637f77c4c79178745517c4ef77b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.542ex; height:2.343ex;" alt="{\displaystyle \alpha ^{*}}" /></span> </td></tr></tbody></table> <p>Jedne z pierwszych praktycznych implementacji wyrażeń regularnych opierały się właśnie na symulacji programowej automatu skończonego. Najpierw budowany jest NAS z <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>&#x3f5;<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3837cad72483d97bcdde49c85d3b7b859fb3fd2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }" /></span>-przejściami zgodnie ze schematem pokazanym wyżej, następnie usuwane są <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>&#x3f5;<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3837cad72483d97bcdde49c85d3b7b859fb3fd2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }" /></span>-przejścia, kolejnym krokiem jest <a href="/wiki/Determinizacja_automatu_sko%C5%84czonego" title="Determinizacja automatu skończonego">determinizacja automatu skończonego</a>, czego wynikiem jest otrzymanie DAS, ostatnim zaś etapem jego minimalizacja. Symulowanie DAS jest bardzo proste i szybkie; pierwsze narzędzia systemu <a href="/wiki/Unix" title="Unix">Unix</a> używały tej metody, wykorzystuje ją również język <a href="/wiki/AWK" title="AWK">AWK</a>, <a href="/wiki/Tcl_(j%C4%99zyk_programowania)" title="Tcl (język programowania)">Tcl</a>, a także biblioteki dla <a href="/wiki/Haskell" title="Haskell">języka Haskell</a>. </p> <div class="mw-heading mw-heading2"><h2 id="Wyrażenia_regularne_w_praktyce"><span id="Wyra.C5.BCenia_regularne_w_praktyce"></span>Wyrażenia regularne w praktyce</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=6" title="Edytuj sekcję: Wyrażenia regularne w praktyce" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=6" title="Edytuj kod źródłowy sekcji: Wyrażenia regularne w praktyce"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Porównanie_składni_praktycznej_z_teoretyczną"><span id="Por.C3.B3wnanie_sk.C5.82adni_praktycznej_z_teoretyczn.C4.85"></span>Porównanie składni praktycznej z teoretyczną</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=7" title="Edytuj sekcję: Porównanie składni praktycznej z teoretyczną" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=7" title="Edytuj kod źródłowy sekcji: Porównanie składni praktycznej z teoretyczną"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Na początku zostaną pokazane różnice i części wspólne zapisu teoretycznego i praktycznego. </p> <table class="wikitable"> <tbody><tr> <th>Informatyka teoretyczna </th> <th>Praktyka </th> <th>Komentarz </th></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \varnothing ,\epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi class="MJX-variant">&#x2205;<!-- ∅ --></mi> <mo>,</mo> <mi>&#x3f5;<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \varnothing ,\epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5f82634f7dd5a90d3b4038f3ab1e6c94749495ff" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.786ex; height:2.343ex;" alt="{\displaystyle \varnothing ,\epsilon }" /></span></td> <td>brak, "" </td> <td>w praktyce zbioru pustego nie podaje się wprost, w większości języków programowania słowo puste jest oznaczane przez <code>""</code> (parę cudzysłowów) </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (,\;)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <mo>,</mo> <mspace width="thickmathspace"></mspace> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (,\;)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4b02fcafad0fb1218efd0b030aeab43e721a8d38" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:3.488ex; height:2.843ex;" alt="{\displaystyle (,\;)}" /></span> </td> <td><code>(</code>, <code>)</code> lub <code>\(</code>, <code>\)</code> </td> <td>w niektórych implementacjach symbole specjalne poprzedza się backslashem </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle +}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo>+</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle +}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fe6ef363cd19902d1a7a71fb1c8b21e8ede52406" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:1.808ex; height:2.176ex;" alt="{\displaystyle +}" /></span></td> <td><code>|</code> lub <code>\|</code> </td> <td>jw. </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0+1+2+3+a+b+c+d+e+f+g+h}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mn>0</mn> <mo>+</mo> <mn>1</mn> <mo>+</mo> <mn>2</mn> <mo>+</mo> <mn>3</mn> <mo>+</mo> <mi>a</mi> <mo>+</mo> <mi>b</mi> <mo>+</mo> <mi>c</mi> <mo>+</mo> <mi>d</mi> <mo>+</mo> <mi>e</mi> <mo>+</mo> <mi>f</mi> <mo>+</mo> <mi>g</mi> <mo>+</mo> <mi>h</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle 0+1+2+3+a+b+c+d+e+f+g+h}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/34ede1d58e96819f4181c3490f1fd3cd0a07bbb0" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:45.161ex; height:2.509ex;" alt="{\displaystyle 0+1+2+3+a+b+c+d+e+f+g+h}" /></span> </td> <td><code>[0123abcdefgh]</code> lub krócej <code>[0-3a-h]</code> </td> <td>zakres znaków (dokładny opis – patrz niżej) </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a+b+\ldots +z+A+B+\ldots +Z}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>a</mi> <mo>+</mo> <mi>b</mi> <mo>+</mo> <mo>&#x2026;<!-- … --></mo> <mo>+</mo> <mi>z</mi> <mo>+</mo> <mi>A</mi> <mo>+</mo> <mi>B</mi> <mo>+</mo> <mo>&#x2026;<!-- … --></mo> <mo>+</mo> <mi>Z</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle a+b+\ldots +z+A+B+\ldots +Z}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d2d011ee7fde22860b14efca231e29c0c68fed21" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:33.832ex; height:2.343ex;" alt="{\displaystyle a+b+\ldots +z+A+B+\ldots +Z}" /></span> </td> <td><code>.</code> </td> <td>dowolny znak z alfabetu (tutaj małe i duże litery, w praktyce cały zestaw znaków); w teoretycznym zapisie wymaga wyliczenia wszystkich znaków z alfabetu </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle ^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msup> <mi></mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle ^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5156ec8960b3bb95881ad7179c891c47fdfa8b9d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.171ex; width:1.054ex; height:2.176ex;" alt="{\displaystyle ^{*}}" /></span></td> <td><code>*</code> lub <code>\*</code> </td> <td>0 lub więcej wystąpień </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e+\epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>e</mi> <mo>+</mo> <mi>&#x3f5;<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle e+\epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/72c3861d58f808e16109b169b35bb023734a27e7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:4.868ex; height:2.176ex;" alt="{\displaystyle e+\epsilon }" /></span></td> <td><code>e?</code> </td> <td>wyrażenie <code>e</code> występuje 0 lub 1 raz </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle ee^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>e</mi> <msup> <mi>e</mi> <mrow class="MJX-TeXAtom-ORD"> <mo>&#x2217;<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle ee^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7d7c00426836cc86ac4d9a18db8a69e9ef7ebe6d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:3.221ex; height:2.343ex;" alt="{\displaystyle ee^{*}}" /></span></td> <td><code>e+</code> </td> <td>wyrażenie <code>e</code> występuje 1 lub więcej razy </td></tr> <tr> <td>brak</td> <td><a href="/wiki/Kareta_(znak)" title="Kareta (znak)">^</a> </td> <td>metaznak oznaczający początek łańcucha (lub początek wiersza, jeśli przetwarzane są wielowierszowe napisy); w teoretycznych rozważaniach dopasowuje się całe słowa, podczas gdy w praktyce zwykle celem jest znalezienie dopasowania wewnątrz dłuższego tekstu, dlatego dopasowanie do całości wymaga dodatkowych oznaczeń <p>w zapisie [^<code>e</code>] oznacza negację <code>e</code> </p> </td></tr> <tr> <td>brak</td> <td>$ </td> <td>metaznak oznaczający koniec łańcucha </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle eeee}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>e</mi> <mi>e</mi> <mi>e</mi> <mi>e</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle eeee}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/078ce774e8f5bbce54a37cf7b06ea518ec78b0cd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:4.334ex; height:1.676ex;" alt="{\displaystyle eeee}" /></span></td> <td><code>e{4}</code> </td> <td>określona liczba powtórzeń (tutaj 4); rozszerzenie Perla </td></tr> <tr> <td><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle eeee(e+\epsilon )(e+\epsilon )(e+\epsilon )}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>e</mi> <mi>e</mi> <mi>e</mi> <mi>e</mi> <mo stretchy="false">(</mo> <mi>e</mi> <mo>+</mo> <mi>&#x3f5;<!-- ϵ --></mi> <mo stretchy="false">)</mo> <mo stretchy="false">(</mo> <mi>e</mi> <mo>+</mo> <mi>&#x3f5;<!-- ϵ --></mi> <mo stretchy="false">)</mo> <mo stretchy="false">(</mo> <mi>e</mi> <mo>+</mo> <mi>&#x3f5;<!-- ϵ --></mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle eeee(e+\epsilon )(e+\epsilon )(e+\epsilon )}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f0f8833dacf79cc0951f73853dc755d39ff1a2cf" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:24.366ex; height:2.843ex;" alt="{\displaystyle eeee(e+\epsilon )(e+\epsilon )(e+\epsilon )}" /></span> </td> <td><code>e{4,7}</code> </td> <td>określony zakres liczby powtórzeń wyrażenia <code>e</code> (tutaj od 4 do 7); rozszerzenie Perla </td></tr></tbody></table> <div class="mw-heading mw-heading3"><h3 id="Podstawowe_elementy">Podstawowe elementy</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=8" title="Edytuj sekcję: Podstawowe elementy" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=8" title="Edytuj kod źródłowy sekcji: Podstawowe elementy"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Podstawowe elementy wyrażeń regularnych: </p> <ul><li>Każdy znak, oprócz znaków specjalnych, określa sam siebie, np. <code>a</code> określa łańcuch złożony ze znaku <code>a</code>.</li> <li>Kolejne symbole oznaczają, że w łańcuchu muszą wystąpić dokładnie te symbole w dokładnie takiej samej kolejności, np. <code>ab</code> oznacza że łańcuch musi składać się z litery <code>a</code> poprzedzającej literę <code>b</code>.</li> <li>Kropka <code>.</code> oznacza dowolny znak z wyjątkiem znaku nowego wiersza (zależnie od ustawień i rodzaju wyrażeń).</li> <li>Znaki specjalne poprzedzone odwrotnym ukośnikiem <code>\</code> powodują, że poprzedzanym znakom nie są nadawane żadne dodatkowe znaczenia i oznaczają same siebie, np. <code>\.</code> oznacza znak kropki (a nie dowolny znak).</li> <li>Zestaw znaków między nawiasami kwadratowymi oznacza jeden dowolny znak objęty nawiasami kwadratowymi, np. <code>[abc]</code> oznacza a, b lub c. Można używać także przedziałów: <code>[a-c]</code>. Między nawiasami kwadratowymi: <ul><li>Daszek <code>^</code> na początku zestawu oznacza wszystkie znaki oprócz tych z zestawu.</li> <li>Aby uniknąć niejasności, znaki <code>-</code> (łącznik) i <code>]</code> (zamknięcie nawiasu kwadratowego) zapisywane są na skraju zestawu lub w niektórych systemach po znaku odwrotnego ukośnika, daszek zaś wszędzie z wyjątkiem początku łańcucha. Zasady te mogą być różne w zależności od konkretnej implementacji.</li> <li>Większość znaków specjalnych w tym miejscu traci swoje znaczenie.</li></ul></li> <li>Pomiędzy nawiasami okrągłymi <code>(</code> i <code>)</code> grupuje się symbole do ich późniejszego wykorzystania.</li> <li>Gwiazdka <code>*</code> po symbolu (nawiasie, pojedynczym znaku) nazywana jest <a href="/wiki/Domkni%C4%99cie_Kleene%E2%80%99ego" title="Domknięcie Kleene’ego">domknięciem Kleene’a</a> i oznacza zero lub więcej wystąpień poprzedzającego wyrażenia.</li> <li>Znak zapytania <code>?</code> po symbolu oznacza najwyżej jedno (być może zero) wystąpienie poprzedzającego wyrażenia.</li> <li>Plus <code>+</code> po symbolu oznacza co najmniej jedno wystąpienie poprzedzającego go wyrażenia.</li> <li>Daszek <code>^</code> oznacza początek wiersza, dolar <code>$</code> oznacza koniec wiersza.</li> <li>Pionowa kreska (ang. <em lang="en">pipeline</em>) <code>|</code> to operator OR np., jeśli napiszemy <code>a|b|c</code>, oznacza to, że w danym wyrażeniu może wystąpić <code>a</code> lub <code>b</code> lub <code>c</code>.</li> <li>Znaki <code>\&lt;</code>, <code>\&gt;</code> oznaczające początek i koniec wyrazu (w niektórych implementacjach występuje pełniący podobną funkcję metaznak <code>\b</code>). Np. <code>\&lt;al</code> znajdzie wszystkie wyrazy zaczynające się na <code>al</code>. <code>et\&gt;</code> znajdzie wyrazy które kończą się na <code>et</code>.</li></ul> <dl><dt>Przykład 1</dt></dl> <p>Polski <a href="/wiki/Kod_pocztowy" title="Kod pocztowy">kod pocztowy</a> składa się z sekwencji następujących elementów: </p> <ul><li>dwóch cyfr (<code>[0-9][0-9]</code>),</li> <li>dywizu (<code>-</code>),</li> <li>trzech cyfr (<code>[0-9][0-9][0-9]</code>).</li></ul> <p>Ostatecznie wyrażenie regularne, które opisuje kod pocztowy <code>[0-9][0-9]-[0-9][0-9][0-9]</code> lub wykorzystując opisane niżej rozszerzenia perla: <code>[0-9]{2}-[0-9]{3}</code>. </p> <dl><dt>Przykład 2</dt></dl> <p>Anglosaski napis reprezentujący liczbę rzeczywistą składa się z następujących elementów: </p> <ul><li>opcjonalnego znaku (<code>[+-]?</code>);</li> <li>przynajmniej jednej cyfry (<code>[0-9]+</code>);</li> <li>opcjonalnej części ułamkowej (<code>?</code>), która składa się z kolei z: <ul><li>kropki dziesiętnej (<code>\.</code>);</li> <li>przynajmniej jednej cyfry (<code>[0-9]+</code>).</li></ul></li></ul> <p>Wyrażenie regularne opisujące taki napis: <code>[+-]?[0-9]+(\.[0-9]+)?</code>. </p> <dl><dt>Przykład 3</dt></dl> <p>Wyrażenie sprawdzające poprawność <a href="/wiki/Adres_poczty_elektronicznej" title="Adres poczty elektronicznej">adresów poczty elektronicznej</a> (w wersji uproszczonej, opisujące adresy w najpopularniejszej formie): <code>^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,}){1}$</code>. </p> <div class="mw-heading mw-heading3"><h3 id="Rozszerzenia_Perla">Rozszerzenia Perla</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=9" title="Edytuj sekcję: Rozszerzenia Perla" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=9" title="Edytuj kod źródłowy sekcji: Rozszerzenia Perla"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Rozszerzenia <a href="/wiki/Perl" title="Perl">Perla</a> to między innymi: </p> <ul><li>Negacja zestawu (wszystko, co nie należy do zestawu). <ul><li>cyfry są zastępowane znakami \d (dowolna cyfra) i \D (wszystko co nie jest cyfrą)</li> <li>znaki „białe” \s i \S (przeciwieństwo)</li></ul></li> <li>Rozszerzony zapis przedziałów, wprowadzenie klas znaków np.: <ul><li><code>[:digit:]</code> oznacza dowolną cyfrę</li> <li><code>[:alpha:]</code> literę</li> <li><code>[:alnum:]</code> literę lub cyfrę</li></ul></li> <li>Możliwość precyzyjnego określenia liczby wystąpień danego wyrażenia <ul><li>wyrażenie <code>{N}</code> oznacza dokładnie <span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">N</span> wystąpień</li> <li>wyrażenie <code>{N,}</code> co najmniej <span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">N</span> wystąpień wyrażenia</li> <li>wyrażenie <code>{,M}</code> co najwyżej <span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">M</span> wystąpień wyrażenia</li> <li>wyrażenie <code>{N,M}</code> od <span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">N</span> do <span style="font-family: Nimbus Roman No9 L,Times New Roman,Times,serif; font-size: 118%; line-height: 1; font-style: italic;">M</span> wystąpień wyrażenia</li></ul></li> <li>Referencje wsteczne, czyli możliwość odwoływania się do odnalezionych podciągów zgrupowanych poprzez nawiasy. Np. w wyrażeniu <code>(.*)\1</code> referencją wsteczną jest „<code>\1</code>” i oznacza powtórzenie ciągu znalezionego w ramach pierwszej grupy nawiasów. To rozszerzenie pozwala definiować języki, które nie są regularne.</li></ul> <div class="mw-heading mw-heading3"><h3 id="Wyrażenia_zachłanne"><span id="Wyra.C5.BCenia_zach.C5.82anne"></span>Wyrażenia zachłanne</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=10" title="Edytuj sekcję: Wyrażenia zachłanne" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=10" title="Edytuj kod źródłowy sekcji: Wyrażenia zachłanne"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p><a href="/wiki/Kwantyfikator" title="Kwantyfikator">Kwantyfikatory</a> w wyrażeniach regularnych dopasowują tak wiele znaków, jak to możliwe, są to więc tzw. wyrażenia zachłanne (<em lang="en">greedy</em> – z <a href="/wiki/J%C4%99zyk_angielski" title="Język angielski">ang.</a> <i>zachłanne</i>, <i>łapczywe</i>). Może to być znaczącym problemem. Przykładowo, aby dopasować pierwszy element, znajdujący się w podwójnych nawiasach kwadratowych w tekście: </p> <dl><dd><i>Kolejna eksplozja wieloryba nastąpiła na <code>[[Tajwan]]ie, [[26 stycznia]] [[1990]]</code>.</i></dd></dl> <p>użytkownik użyłby najchętniej wyrażenia <code>(\[\[.*\]\])</code>, które wygląda poprawnie (nawias kwadratowy powinien być interpretowany jako znak, dlatego poprzedzony jest odwrotnym ukośnikiem), jednak zwróci ciąg <code>[[Tajwan]]ie, [[26 stycznia]] [[1990]]</code> zamiast oczekiwanego <code>[[Tajwan]]</code>. </p><p>Są dwie metody na uniknięcie tego problemu. Po pierwsze, zamiast określać, co powinno być dopasowane, można określić, co nie powinno być dopasowane. W tym przypadku ] jest znakiem niepożądanym, więc wyrażenie miałoby postać <code>(\[\[[^\]]*\]\])</code>. Jednak nie uda się w ten sposób dopasować ciągu znaków w postaci: </p> <dl><dd><i>A B C D E F G</i></dd></dl> <p>Drugą, bardziej współczesną metodą, jest „zmuszenie” kwantyfikatora, aby nie był typu „<span lang="en">greedy</span>”, poprzez dopisanie za nim znaku zapytania <code>(\[\[.*?\]\])</code>. Są to tak zwane „leniwe” (ang. <em lang="en">lazy</em>) odmiany kwantyfikatorów. </p> <div class="mw-heading mw-heading3"><h3 id="Wady_wyrażeń_regularnych"><span id="Wady_wyra.C5.BCe.C5.84_regularnych"></span>Wady wyrażeń regularnych</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=11" title="Edytuj sekcję: Wady wyrażeń regularnych" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=11" title="Edytuj kod źródłowy sekcji: Wady wyrażeń regularnych"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Wyrażenia regularne obecnie nie wspierają<sup id="cite_ref-1" class="reference"><a href="#cite_note-1">[1]</a></sup> obsługi <a href="/wiki/Permutacja" title="Permutacja">permutacji</a> (wedle obecnych definicji i implementacji), tzn. nie ma mechanizmu, który w zwięzły sposób pozwoliłby dopasować np. ciągi znaków „ABC”, „ACB”, „BAC”, „BCA”, „CAB” i „CBA” (potrzebne jest explicite dopasowanie poszczególnych ciągów) </p> <div class="mw-heading mw-heading2"><h2 id="Zobacz_też"><span id="Zobacz_te.C5.BC"></span>Zobacz też</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=12" title="Edytuj sekcję: Zobacz też" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=12" title="Edytuj kod źródłowy sekcji: Zobacz też"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Gramatyka_formalna" title="Gramatyka formalna">gramatyka formalna</a></li> <li><a href="/wiki/Gramatyka_kontekstowa" title="Gramatyka kontekstowa">gramatyka kontekstowa</a></li> <li><a href="/wiki/Gramatyka_regularna" title="Gramatyka regularna">gramatyka regularna</a></li> <li><a href="/wiki/Hierarchia_Chomskiego" title="Hierarchia Chomskiego">hierarchia Chomskiego</a></li> <li><a href="/wiki/Wieloznacznik" title="Wieloznacznik">wieloznacznik</a></li> <li><a href="/wiki/Pomoc:Wyra%C5%BCenia_regularne" title="Pomoc:Wyrażenia regularne">pomoc:Wyrażenia regularne</a></li></ul> <div class="mw-heading mw-heading2"><h2 id="Przypisy">Przypisy</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=13" title="Edytuj sekcję: Przypisy" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=13" title="Edytuj kod źródłowy sekcji: Przypisy"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="do-not-make-smaller refsection"><div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"><cite class="citation web"><a rel="nofollow" class="external text" href="https://qa-stack.pl/cs/100206/why-is-there-no-permutation-in-regexes-even-if-regular-languages-seem-to-be-ab"><i>Dlaczego w Regexach nie ma permutacji? (Nawet jeśli wydaje się, że zwykłe języki to potrafią)</i></a> [online], qa-stack.pl<span class="accessdate"> [dostęp 2021-10-21]</span><span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft.gengre=book&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.btitle=Dlaczego+w+Regexach+nie+ma+permutacji%3F+%28Nawet+je%C5%9Bli+wydaje+si%C4%99%2C+%C5%BCe+zwyk%C5%82e+j%C4%99zyki+to+potrafi%C4%85%29&amp;rft_id=https%3A%2F%2Fqa-stack.pl%2Fcs%2F100206%2Fwhy-is-there-no-permutation-in-regexes-even-if-regular-languages-seem-to-be-ab" style="display:none">&#160;</span>.</cite></span> </li> </ol></div></div> <div class="mw-heading mw-heading2"><h2 id="Bibliografia">Bibliografia</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=14" title="Edytuj sekcję: Bibliografia" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=14" title="Edytuj kod źródłowy sekcji: Bibliografia"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><cite class="citation book">Jeffrey E.F.&#32;Friedl:&#32;<i>Wyrażenia regularne</i>.&#32;Gliwice&#58;&#32;Helion O'Reilly,&#32;2001. <a href="/wiki/Specjalna:Ksi%C4%85%C5%BCki/8371973519" title="Specjalna:Książki/8371973519">ISBN&#160;<span class="isbn">83-7197-351-9</span></a>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Wyra%C5%BCenia+regularne&amp;rft.aulast=Friedl&amp;rft.aufirst=Jeffrey+E.F.&amp;rft.pub=Helion+O%27Reilly&amp;rft.place=Gliwice&amp;rft.isbn=83-7197-351-9"></span>&#32;<span class="lang-list tylko-pl">(<abbr title="Treść w języku polskim">pol.</abbr>)</span>.</cite><span class="problemy" aria-hidden="true" data-nosnippet=""> Brak numerów stron w książce</span></li> <li><cite class="citation book">Tony&#32;Stubblebine:&#32;<i>Wyrażenia regularne leksykon kieszonkowy Wydanie I</i>.&#32;Gliwice&#58;&#32;Helion O'Reilly,&#32;12 2003. <a href="/wiki/Specjalna:Ksi%C4%85%C5%BCki/8373610758" title="Specjalna:Książki/8373610758">ISBN&#160;<span class="isbn">83-7361-075-8</span></a>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Wyra%C5%BCenia+regularne+leksykon+kieszonkowy+Wydanie+I&amp;rft.aulast=Stubblebine&amp;rft.aufirst=Tony&amp;rft.pub=Helion+O%27Reilly&amp;rft.place=Gliwice&amp;rft.isbn=83-7361-075-8"></span></cite><span class="problemy" aria-hidden="true" data-nosnippet=""> Brak numerów stron w książce</span></li> <li><cite class="citation book">Tony&#32;Stubblebine:&#32;<i>Wyrażenia regularne leksykon kieszonkowy Wydanie II</i>.&#32;Gliwice&#58;&#32;Helion O'Reilly,&#32;01 2008. <a href="/wiki/Specjalna:Ksi%C4%85%C5%BCki/9788324613922" title="Specjalna:Książki/9788324613922">ISBN&#160;<span class="isbn">978-83-246-1392-2</span></a>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Wyra%C5%BCenia+regularne+leksykon+kieszonkowy+Wydanie+II&amp;rft.aulast=Stubblebine&amp;rft.aufirst=Tony&amp;rft.pub=Helion+O%27Reilly&amp;rft.place=Gliwice&amp;rft.isbn=978-83-246-1392-2"></span></cite><span class="problemy" aria-hidden="true" data-nosnippet=""> Brak numerów stron w książce</span></li> <li><cite class="citation book">Hopcroft, John E; Ullman, Jeffrey D; Konikowska, Beata:&#32;<i>Wprowadzenie do teorii automatów, języków i obliczeń</i>.&#32;Warszawa&#58;&#32;Wydawnictwo Naukowe PWN,&#32;2003. <a href="/wiki/Specjalna:Ksi%C4%85%C5%BCki/8301140909" title="Specjalna:Książki/8301140909">ISBN&#160;<span class="isbn">83-01-14090-9</span></a>.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Wprowadzenie+do+teorii+automat%C3%B3w%2C+j%C4%99zyk%C3%B3w+i+oblicze%C5%84&amp;rft.au=Hopcroft%2C+John+E%3B+Ullman%2C+Jeffrey+D%3B+Konikowska%2C+Beata&amp;rft.date=2003&amp;rft.pub=Wydawnictwo+Naukowe+PWN&amp;rft.place=Warszawa&amp;rft.isbn=83-01-14090-9"></span></cite><span class="problemy" aria-hidden="true" data-nosnippet=""> Brak numerów stron w książce</span></li></ul> <div class="mw-heading mw-heading2"><h2 id="Linki_zewnętrzne"><span id="Linki_zewn.C4.99trzne"></span>Linki zewnętrzne</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;veaction=edit&amp;section=15" title="Edytuj sekcję: Linki zewnętrzne" class="mw-editsection-visualeditor"><span>edytuj</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Wyra%C5%BCenie_regularne&amp;action=edit&amp;section=15" title="Edytuj kod źródłowy sekcji: Linki zewnętrzne"><span>edytuj kod</span></a><span class="mw-editsection-bracket">]</span></span></div> <table class="infobox noprint plainlinks" cellpadding="4" role="presentation"> <tbody><tr> <td style="vertical-align:middle; text-align:center; width:30px;"><span class="notpageimage" typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Wikibooks-logo.svg/28px-Wikibooks-logo.svg.png" decoding="async" width="28" height="28" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Wikibooks-logo.svg/42px-Wikibooks-logo.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Wikibooks-logo.svg/56px-Wikibooks-logo.svg.png 2x" data-file-width="300" data-file-height="300" /></span></span> </td> <td style="line-height:normal; vertical-align:middle; text-align:center; flex:unset;">Zobacz publikację<br /><b><a href="https://pl.wikibooks.org/wiki/PHP/Podstawy_wyra%C5%BCe%C5%84_regularnych" class="extiw" title="b:PHP/Podstawy wyrażeń regularnych">PHP/Podstawy wyrażeń regularnych</a></b> w&#160;Wikibooks </td></tr></tbody></table> <ul><li><cite class="citation web"><a rel="nofollow" class="external text" href="http://swtch.com/~rsc/regexp/regexp1.html">Regular Expression Matching Can Be Simple And Fast</a>.&#32;[dostęp 2008-10-11].&#32;<span class="lang-list">(<abbr title="Treść w języku angielskim (English)">ang.</abbr>)</span>.</cite></li> <li><a rel="nofollow" class="external text" href="http://regexpal.com">Tester wyrażeń regularnych w JavaScripcie</a> <span class="lang-list">(<abbr title="Treść w języku angielskim (English)">ang.</abbr>)</span></li> <li><a rel="nofollow" class="external text" href="http://gskinner.com/RegExr">Tester wyrażeń regularnych we Fleksie</a> <span class="lang-list">(<abbr title="Treść w języku angielskim (English)">ang.</abbr>)</span></li> <li><a rel="nofollow" class="external text" href="http://doc.cat-v.org/bell_labs/structural_regexps">Structural Regular Expressions by Rob Pike</a> <span class="lang-list">(<abbr title="Treść w języku angielskim (English)">ang.</abbr>)</span></li> <li><a rel="nofollow" class="external text" href="https://regex101.com">Tester wyrażeń regularnych (JS, PHP, Python)</a> <span class="lang-list">(<abbr title="Treść w języku angielskim (English)">ang.</abbr>)</span></li> <li><a rel="nofollow" class="external text" href="https://www.cheatography.com/davechild/cheat-sheets/regular-expressions">Wyrażenia regularne – ściągawka</a> <span class="lang-list">(<abbr title="Treść w języku angielskim (English)">ang.</abbr>)</span></li> <li><cite class="citation web"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20140209231503/http://office.microsoft.com/en-ca/word-help/find-and-replace-text-by-using-regular-expressions-advanced-HA102350661.aspx">Znajdowanie i zamienianie tekstu za pomocą wyrażeń regularnych (zaawansowane)</a>.&#32;office.microsoft.com.&#32;[zarchiwizowane z <a rel="nofollow" class="external text" href="http://office.microsoft.com/en-ca/word-help/find-and-replace-text-by-using-regular-expressions-advanced-HA102350661.aspx">tego adresu</a>&#32;(2014-02-09)].</cite> – wyrażenia regularne w Microsoft Word – zarchiwizowana strona internetowa oficjalnej pomocy technicznej <span class="lang-list">(<abbr title="Treść w języku angielskim (English)">ang.</abbr>)</span></li></ul> <style data-mw-deduplicate="TemplateStyles:r75562624">.mw-parser-output #normdaten>div+div{margin-top:0.5em}.mw-parser-output #normdaten>div>div{background:var(--background-color-neutral,#eaecf0);padding:.2em .5em}.mw-parser-output #normdaten ul{margin:0;padding:0}.mw-parser-output #normdaten ul li:first-child{padding-left:.5em;border-left:1px solid var(--border-color-base,#a2a9b1)}</style> <div id="normdaten" class="catlinks"><div class="normdaten-typ-s"><div><a href="/wiki/Kontrola_autorytatywna" title="Kontrola autorytatywna">Kontrola autorytatywna</a>&#160;(<span class="description"><a href="/wiki/Dopasowanie_do_wzorca" title="Dopasowanie do wzorca">dopasowanie do wzorca</a></span>):</div><ul><li><a href="/wiki/Library_of_Congress_Control_Number" title="Library of Congress Control Number">LCCN</a>:&#8201;<span class="uid"><a rel="nofollow" class="external text" href="http://lccn.loc.gov/sh2018002310">sh2018002310</a></span></li><li><a href="/wiki/Gemeinsame_Normdatei" title="Gemeinsame Normdatei">GND</a>:&#8201;<span class="uid"><a rel="nofollow" class="external text" href="http://d-nb.info/gnd/4506116-6">4506116-6</a></span></li><li><a href="https://de.wikipedia.org/wiki/Web_NDL_Authorities" class="extiw" title="de:Web NDL Authorities">NDL</a>:&#8201;<span class="uid"><a rel="nofollow" class="external text" href="http://id.ndl.go.jp/auth/ndlna/01121341">01121341</a></span></li><li><a href="/wiki/Biblioth%C3%A8que_nationale" title="Bibliothèque nationale">BnF</a>:&#8201;<span class="uid"><a rel="nofollow" class="external text" href="http://catalogue.bnf.fr/ark:/12148/cb14626171d">14626171d</a></span></li><li><a href="/wiki/Biblioteka_Narodowa_Republiki_Czeskiej" title="Biblioteka Narodowa Republiki Czeskiej">NKC</a>:&#8201;<span class="uid"><a rel="nofollow" class="external text" href="http://aut.nkp.cz/ph594494">ph594494</a></span></li><li><a href="/wiki/Biblioteka_Narodowa_Izraela" title="Biblioteka Narodowa Izraela">J9U</a>:&#8201;<span class="uid"><a rel="nofollow" class="external text" href="http://olduli.nli.org.il/F/?func=find-b&amp;local_base=NLX10&amp;find_code=UID&amp;request=987012575112805171">987012575112805171</a></span></li></ul></div><div class="normdaten-andere"><div><a href="/wiki/Encyklopedia_internetowa" title="Encyklopedia internetowa">Encyklopedie internetowe</a>:</div> <ul><li><a href="/wiki/Store_norske_leksikon" title="Store norske leksikon">SNL</a>:&#8201;<span class="uid"><a class="external text" href="https://wikidata-externalid-url.toolforge.org/?p=4342&amp;url_prefix=https://snl.no/&amp;id=regul%C3%A6re_uttrykk">regulære_uttrykk</a></span></li></ul> </div></div></div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?useformat=desktop&amp;type=1x1&amp;usesul3=0" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Źródło: „<a dir="ltr" href="https://pl.wikipedia.org/w/index.php?title=Wyrażenie_regularne&amp;oldid=75388257">https://pl.wikipedia.org/w/index.php?title=Wyrażenie_regularne&amp;oldid=75388257</a>”</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Specjalna:Kategorie" title="Specjalna:Kategorie">Kategorie</a>: <ul><li><a href="/wiki/Kategoria:J%C4%99zyki_formalne" title="Kategoria:Języki formalne">Języki formalne</a></li><li><a href="/wiki/Kategoria:Konstrukcje_programistyczne" title="Kategoria:Konstrukcje programistyczne">Konstrukcje programistyczne</a></li><li><a href="/wiki/Kategoria:Teoria_automat%C3%B3w" title="Kategoria:Teoria automatów">Teoria automatów</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Ukryte kategorie: <ul><li><a href="/wiki/Kategoria:Zal%C4%85%C5%BCki_sekcji_artyku%C5%82%C3%B3w" title="Kategoria:Zalążki sekcji artykułów">Zalążki sekcji artykułów</a></li><li><a href="/wiki/Kategoria:Szablon_cytowania_ksi%C4%85%C5%BCki_%E2%80%93_brak_numeru_strony" title="Kategoria:Szablon cytowania książki – brak numeru strony">Szablon cytowania książki – brak numeru strony</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> Tę stronę ostatnio edytowano 29 lis 2024, 03:42.</li> <li id="footer-info-copyright">Tekst udostępniany na licencji <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.pl">Creative Commons: uznanie autorstwa, na tych samych warunkach</a>, z możliwością obowiązywania dodatkowych ograniczeń. Zobacz szczegółowe informacje o <a class="external text" href="https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use/pl">warunkach korzystania</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Polityka prywatności</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:O_Wikipedii">O Wikipedii</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:Korzystasz_z_Wikipedii_tylko_na_w%C5%82asn%C4%85_odpowiedzialno%C5%9B%C4%87">Korzystasz z Wikipedii tylko na własną odpowiedzialność</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Powszechne Zasady Postępowania</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Dla deweloperów</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/pl.wikipedia.org">Statystyki</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Oświadczenie o ciasteczkach</a></li> <li id="footer-places-mobileview"><a href="//pl.m.wikipedia.org/w/index.php?title=Wyra%C5%BCenie_regularne&amp;mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Wersja mobilna</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><picture><source media="(min-width: 500px)" srcset="/static/images/footer/wikimedia-button.svg" width="84" height="29"><img src="/static/images/footer/wikimedia.svg" width="25" height="25" alt="Wikimedia Foundation" lang="en" loading="lazy"></picture></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><picture><source media="(min-width: 500px)" srcset="/w/resources/assets/poweredby_mediawiki.svg" width="88" height="31"><img src="/w/resources/assets/mediawiki_compact.svg" alt="Powered by MediaWiki" lang="en" width="25" height="25" loading="lazy"></picture></a></li> </ul> </footer> </div> </div> </div> <div class="vector-header-container vector-sticky-header-container"> <div id="vector-sticky-header" class="vector-sticky-header"> <div class="vector-sticky-header-start"> <div class="vector-sticky-header-icon-start vector-button-flush-left vector-button-flush-right" aria-hidden="true"> <button class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-sticky-header-search-toggle" tabindex="-1" data-event-name="ui.vector-sticky-search-form.icon"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Szukaj</span> </button> </div> <div role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box"> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail"> <form action="/w/index.php" id="vector-sticky-search-form" class="cdx-search-input cdx-search-input--has-end-button"> <div class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Przeszukaj Wikipedię"> <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Specjalna:Szukaj"> </div> <button class="cdx-button cdx-search-input__end-button">Szukaj</button> </form> </div> </div> </div> <div class="vector-sticky-header-context-bar"> <nav aria-label="Spis treści" class="vector-toc-landmark"> <div id="vector-sticky-header-toc" class="vector-dropdown mw-portlet mw-portlet-sticky-header-toc vector-sticky-header-toc vector-button-flush-left" > <input type="checkbox" id="vector-sticky-header-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-sticky-header-toc" class="vector-dropdown-checkbox " aria-label="Przełącz stan spisu treści" > <label id="vector-sticky-header-toc-label" for="vector-sticky-header-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Przełącz stan spisu treści</span> </label> <div class="vector-dropdown-content"> <div id="vector-sticky-header-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div class="vector-sticky-header-context-bar-primary" aria-hidden="true" ><span class="mw-page-title-main">Wyrażenie regularne</span></div> </div> </div> <div class="vector-sticky-header-end" aria-hidden="true"> <div class="vector-sticky-header-icons"> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-talk-sticky-header" tabindex="-1" data-event-name="talk-sticky-header"><span class="vector-icon mw-ui-icon-speechBubbles mw-ui-icon-wikimedia-speechBubbles"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-subject-sticky-header" tabindex="-1" data-event-name="subject-sticky-header"><span class="vector-icon mw-ui-icon-article mw-ui-icon-wikimedia-article"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-history-sticky-header" tabindex="-1" data-event-name="history-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-history mw-ui-icon-wikimedia-wikimedia-history"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only mw-watchlink" id="ca-watchstar-sticky-header" tabindex="-1" data-event-name="watch-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-star mw-ui-icon-wikimedia-wikimedia-star"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-ve-edit-sticky-header" tabindex="-1" data-event-name="ve-edit-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-edit mw-ui-icon-wikimedia-wikimedia-edit"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-edit-sticky-header" tabindex="-1" data-event-name="wikitext-edit-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-wikiText mw-ui-icon-wikimedia-wikimedia-wikiText"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-viewsource-sticky-header" tabindex="-1" data-event-name="ve-edit-protected-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-editLock mw-ui-icon-wikimedia-wikimedia-editLock"></span> <span></span> </a> </div> <div class="vector-sticky-header-buttons"> <button class="cdx-button cdx-button--weight-quiet mw-interlanguage-selector" id="p-lang-btn-sticky-header" tabindex="-1" data-event-name="ui.dropdown-p-lang-btn-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>58 języków</span> </button> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive" id="ca-addsection-sticky-header" tabindex="-1" data-event-name="addsection-sticky-header"><span class="vector-icon mw-ui-icon-speechBubbleAdd-progressive mw-ui-icon-wikimedia-speechBubbleAdd-progressive"></span> <span>Dodaj temat</span> </a> </div> <div class="vector-sticky-header-icon-end"> <div class="vector-user-links"> </div> </div> </div> </div> </div> <div class="mw-portlet mw-portlet-dock-bottom emptyPortlet" id="p-dock-bottom"> <ul> </ul> </div> <script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-76d4c66f66-j65l5","wgBackendResponseTime":185,"wgPageParseReport":{"limitreport":{"cputime":"0.263","walltime":"0.494","ppvisitednodes":{"value":3933,"limit":1000000},"postexpandincludesize":{"value":21638,"limit":2097152},"templateargumentsize":{"value":4388,"limit":2097152},"expansiondepth":{"value":9,"limit":100},"expensivefunctioncount":{"value":4,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":4005,"limit":5000000},"entityaccesscount":{"value":2,"limit":400},"timingprofile":["100.00% 272.648 1 -total"," 29.41% 80.176 1 Szablon:Kontrola_autorytatywna"," 19.47% 53.090 4 Szablon:Cytuj_książkę"," 15.14% 41.281 1 Szablon:Przypisy"," 11.81% 32.204 1 Szablon:Ang."," 11.29% 30.773 1 Szablon:Cytuj"," 10.75% 29.314 1 Szablon:W_języku"," 7.45% 20.311 2 Szablon:Cytuj_stronę"," 6.62% 18.050 1 Szablon:Sekcja_stub"," 5.57% 15.186 1 Szablon:Dmbox"]},"scribunto":{"limitreport-timeusage":{"value":"0.090","limit":"10.000"},"limitreport-memusage":{"value":3270098,"limit":52428800},"limitreport-logs":"ext = nil\next = false\next = nil\nrequired = table#1 {\n}\nrequired = table#1 {\n}\nrequired = table#1 {\n}\nrequired = table#1 {\n}\nrequired = table#1 {\n}\nrequired = table#1 {\n}\nrequired = table#1 {\n}\nrequired = table#1 {\n}\n"},"cachereport":{"origin":"mw-web.eqiad.main-d74f6cf78-xkzbg","timestamp":"20250213212516","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Wyra\u017cenie regularne","url":"https:\/\/pl.wikipedia.org\/wiki\/Wyra%C5%BCenie_regularne","sameAs":"http:\/\/www.wikidata.org\/entity\/Q185612","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q185612","author":{"@type":"Organization","name":"Wsp\u00f3\u0142tw\u00f3rcy projekt\u00f3w Fundacji Wikimedia"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2002-04-03T18:32:07Z"}</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10