1

Topic: To correlate a line with a mask

Greetings, we Admit there is a line, a domain name - "facebook.com" And there is other line which can contain a mask, for example "*fa*b*k.com/so*page *" It is necessary to define, whether the first line enters into a rule set in the second line (in the given example - enters). How it is better for making? The bicycle, for certain the task simply would not be desirable to invent dares with the help boost or std.

2

Re: To correlate a line with a mask

Hello, dwebster, you wrote: D> As it is better for making? The bicycle, for certain the task simply would not be desirable to invent dares with the help boost or std. http://www.cplusplus.com/reference/regex/

3

Re: To correlate a line with a mask

Hello, dwebster, you wrote: D> It is admissible there is a line, a domain name - "facebook.com" D> And there is other line which can contain a mask, for example "*fa*b*k.com/so*page *" D> It is necessary to define, whether the first line enters into a rule set in the second line (in the given example - enters). The asterisk means, what under it the zero, one, or the arbitrary number of characters can disappear? If so it seems that you somewhere confused in a statement. After all then under the stars can disappear anything you like, including a required line entirely! And for the answer in this case it is not necessary even to look at it bool contains (const std::string& needle/* = "facebook.com" */, const std::string& haystack/* = "*fa*b*k.com/so*page *" */) {return haystack.find (' * ')! = std:: string:: npos || haystack.find (needle)! = std:: string:: npos;}

4

Re: To correlate a line with a mask

Hello, dwebster, you wrote: D> It is admissible there is a line, a domain name - "facebook.com" D> And there is other line which can contain a mask, for example "*fa*b*k.com/so*page *" https://github.com/MichaelCook/glob_match

5

Re: To correlate a line with a mask

Hello, dwebster, you wrote: D> Greetings, D> Are admissible there is a line, a domain name - "facebook.com" D> And there is other line which can contain a mask, for example "*fa*b*k.com/so*page *" I would overtake glob-expression in the regular expression and  lines this regular expression.