Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用 Qt QRegExp 写简单的正则表达式
我想用“硬写”和表示任何整数来获取 Qstring 的所有子字符串table(i, d),不带引号。然后使用 cap 来检索. 我提议idd
table(i, d)
i
d
qREgExp reg ( "table(i,\\s*(\\d+)\\s*)") ;
我珍惜那时的希望
reg.cap(2)
给我d这里的问题。
你会怎么写?
尝试使用
qREgExp reg ( "\\btable\\(i,\\s*(\\d+)\\s*\\)" );
和
reg.cap(1)