◐ Shell
clean mode source ↗

std::regex_search — cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Déclaré dans l'en-tête

<regex>

template< class BidirIt, class Alloc, class CharT, class Traits > bool regex_search( BidirIt first, BidirIt last, std::match_results<BidirIt,Alloc>& m, const std::basic_regex<CharT,Traits>& e, std::regex_constants::match_flag_type flags = std::regex_constants::match_default );

(1) (depuis C++11)

template< class Alloc, class CharT, class Traits > bool regex_search( const CharT* str, std::match_results<BidirIt,Alloc>& m, const std::basic_regex<CharT,Traits>& e, std::regex_constants::match_flag_type flags = std::regex_constants::match_default );

(2) (depuis C++11)

template< class STraits, class SAlloc, class Alloc, class CharT, class Traits > bool regex_search( const std::basic_string<CharT,STraits,SAlloc>& s, std::match_results< typename std::basic_string<CharT,STraits,SAlloc>::const_iterator, Alloc >& m, const std::basic_regex<CharT, Traits>& e, std::regex_constants::match_flag_type flags = std::regex_constants::match_default );

(3) (depuis C++11)

template< class BidirIt, class CharT, class Traits > bool regex_search( BidirIt first, BidirIt last, const std::basic_regex<CharT,Traits>& e, std::regex_constants::match_flag_type flags = std::regex_constants::match_default );

(4) (depuis C++11)

template< class CharT, class Traits > bool regex_search( const CharT* str, const std::basic_regex<CharT,Traits>& e, std::regex_constants::match_flag_type flags = std::regex_constants::match_default );

(5) (depuis C++11)

template< class STraits, class SAlloc, class CharT, class Traits > bool regex_search( const std::basic_string<CharT,STraits,SAlloc>& s, const std::basic_regex<CharT,Traits>& e, std::regex_constants::match_flag_type flags = std::regex_constants::match_default );

(6) (depuis C++11)

1)

Détermine s'il ya un match entre le e express régulier et une sous-séquence dans la séquence cible [first,last) caractère. Les résultats des matchs sont retournés dans m .

Original:

Determines if there is a match between the regular express e and some subsequence in the target character sequence [first,last). Match results are returned in m.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

2)

Std :: Retours regex_search (str, str + std :: char_traits <charT> :: length (str), m, e, drapeaux) .

Original:

Returns std::regex_search(str, str + std::char_traits<charT>::length(str), m, e, flags).

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

3)

Std :: Retours regex_search (s.begin (), s.end (), m, e, drapeaux) .

Original:

Returns std::regex_search(s.begin(), s.end(), m, e, flags).

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

4)

La même chose que (1), en omettant les résultats des matchs .

Original:

The same as (1), omitting the match results.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

5)

Std :: Retours regex_search (str, str + std :: char_traits <charT> :: length (str), e, drapeaux) .

Original:

Returns std::regex_search(str, str + std::char_traits<charT>::length(str), e, flags).

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

6)

Std :: Retours regex_search (s.begin (), s.end (), e, drapeaux) .

Original:

Returns std::regex_search(s.begin(), s.end(), e, flags).

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Paramètres

first, last -

la plage de caractères cible

Original:

the target character range

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

m -

les résultats des matchs

Original:

the match results

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

str -

un caractère objectif zéro terminal C de type chaîne de caractères

Original:

a target character null-terminated C-style string

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

s -

un std :: basic_string caractères cible

Original:

a target character std::basic_string

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

e -

le std :: regex

Original:

the std::regex

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

flags -

les drapeaux du match

Original:

the match flags

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Type requirements
-BidirIt must meet the requirements of BidirectionalIterator.
-Alloc must meet the requirements of Allocator.

Retourne la valeur

Retours true si une correspondance existe quelque part dans la séquence cible, false autrement .

Original:

Returns true if a match exists somewhere in the target sequence, false otherwise.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.