Back to index

nordugrid-arc-nox  1.1.0~rc6
test_regex.cpp File Reference
#include <ArcRegex.h>
#include <string>
#include <list>
#include <iostream>

Go to the source code of this file.


int main (void)

Function Documentation

int main ( void  )

Definition at line 8 of file test_regex.cpp.

  std::string str = "[@id=\"ahssgf0afhha0-adja-dkkda\"]";
  std::string r = "([a-zA-Z0-9_\\\\-]*)=\"([a-zA-Z0-9_\\\\-]*)\"";
  Arc::RegularExpression rx(r);
  if (rx.isOk()) {
    std::list<std::string> ump, mp;
    rx.match(str, ump, mp);
    std::list<std::string>::iterator it;
    for (it = mp.begin(); it != mp.end(); it++)
      std::cout << (*it) << std::endl;
    std::cout << "Invalid regexp" << std::endl;
  return 0;

Here is the call graph for this function: