S
S
Sanders Rocket2020-07-17 10:41:39
C++ / C#
Sanders Rocket, 2020-07-17 10:41:39

How to use c++ regular expressions?

string sText = text;
      smatch nbiz;
      smatch tbiz;
      smatch obiz;	
      char numberbiz = regex_match(sText, nbiz, regex("{73B461}Номер бизнеса: {FFFFFF}(\\d+)"));
      char tipbiz = regex_match(sText, tbiz, regex("{73B461}Тип бизнеса: {FFFFFF}(.+){73B461}Владелец:"));
      char ownerbiz = regex_match(sText, obiz, regex("{73B461}Владелец: {FFFFFF}(\\w+_\\w+)"));
      SF->getSAMP()->getChat()->AddChatMessage(-1, "Text: %s | %s | %s", nbiz[0], tbiz[0], obiz[0]);

How to get only numbers from business number, only letters(cyrillic) from business type and only owner[everything after :] ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question