Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Porównuje ciąg znaków z wyrażeniem regularnym. Zwraca listę pasujących ciągów.
Wykorzystanie
Zwroty
String.match(regex, flags)
Lista
Argument
Typ
Szczegóły
to: input
Ciąg znaków
Ciąg znaków, w którym ma nastąpić wyszukiwanie.
regex
Ciąg znaków
Wyrażenie regularne do dopasowania.
flags
Ciąg tekstowy, domyślnie: ""
Ciąg znaków określający kombinację flag wyrażenia regularnego, a konkretnie jedną lub więcej z tych flag: „g” (dopasowanie globalne) lub „i” (ignorowanie wielkości liter).
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["The `String.match()` method searches a string for a specified regular expression and returns a list of matches."],["It accepts the input string, the regular expression pattern, and optional flags ('g' for global match and 'i' for case-insensitive search)."],["If a match is found, the method returns a list containing the matching substring(s); otherwise, it returns an empty list."],["You can use various regular expression patterns and flags to control the matching behavior, including character classes, quantifiers, and anchors."]]],["The `String.match()` function searches a string (`input`) for matches to a given regular expression (`regex`). It returns a list of matching strings. Optional flags (`flags`) modify the search, such as 'g' for global matching or 'i' for case-insensitive matching. The examples demonstrate various regex patterns and flag combinations. The function returns an empty string if the pattern is empty, or list of matching strings when successful. The examples cover the use case for Javascript and Python.\n"]]