File: std_regex.cpp

package info (click to toggle)
benchmark 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,708 kB
  • sloc: cpp: 13,013; python: 2,390; ansic: 38; sh: 28; makefile: 12
file content (10 lines) | stat: -rw-r--r-- 259 bytes parent folder | download | duplicates (71)
1
2
3
4
5
6
7
8
9
10
#include <regex>
#include <string>
int main() {
  const std::string str = "test0159";
  std::regex re;
  re = std::regex("^[a-z]+[0-9]+$",
       std::regex_constants::extended | std::regex_constants::nosubs);
  return std::regex_search(str, re) ? 0 : -1;
}