Home > other >  Regex for arrays other than text (string)
Regex for arrays other than text (string)

Time:01-30

I have an array of integers. Like 1, 2, 3, 4, .... Is it possible to make something similar like regex searches for text? E.g. I want to search for 7.*7. To see if there are two sevens in it. Or 1.7.1. And so on.

CodePudding user response:

Is it possible to make regex searches on it, like for text.

Well,

No

Regex cannot be applied to other data structures than strings / text.

You can easily apply search rules using a lambda function and std::find_if() et al. with standard container classes though.

  •  Tags:  
  • Related