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 的正则表达式和语法高亮。我必须突出显示所有带有.so扩展名的文件:
.so
file2d.so,test.so等。
file2d.so
test.so
这一个:QRegExp("\\w\\.so")在字符串file2d.so中仅突出显示d.so部分。
QRegExp("\\w\\.so")
d.so
如何匹配所有单词直到空格以获取文件的全名。
您的正则表达式仅匹配一个字符。您需要使用 a+来匹配一个或多个。
+
\w+\.so将匹配 *.so 文件的完整文件名,前提是文件名中没有空格。
\w+\.so
您只匹配一个字符,并且您的正则表达式不支持所有文件名。你想要的 QRegExp 是QRegExp("[\\w\\-.]+\\.so")
QRegExp("[\\w\\-.]+\\.so")
I am currently attempting to add a listener to my button so that when it is clicked it loads what is in the 'textId' textfield into an html text above said textfield and button. This is so th