Guest User

Untitled

a guest
Dec 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. QRegularExpression Reg("^\[ABC=\d+.?\d*\]\n$");
  2. if(line.contains(Reg))
  3. {
  4. curABC = line.mid(5,line.length()-7);
  5. }
  6.  
  7. QRegularExpression rx("^\[ABC=(\d+.?\d*)\]\s*$");
  8. QRegularExpressionMatch match = rx.match (line);
  9.  
  10. if (match.hasMatch ()) {
  11. curABC = match.captured (1);
  12. }
  13.  
  14. #include <string_view>
  15.  
  16. constexpr size_t prefix_len = ("ABC="sv).length();
  17.  
  18. size_t prefix_len = sizeof("ABC=") - 1;
Add Comment
Please, Sign In to add comment