Please someone provide me code for matching parenthesis and Brackets using regular expressions.
Please someone provide me code for matching parenthesis and Brackets using regular expressions.
Is this some kind of school assignment ? There is another thread about this here : link .
I had tried these codes but they are not working..
functionFormat1.setFontItalic(false);
functionFormat1.setForeground(Qt::green);
rule.pattern = QRegExp("[([^\]]+)]");
rule.format = functionFormat1;
highlightingRules.append(rule);
functionFormat1.setFontItalic(false);
functionFormat1.setForeground(Qt::green);
rule.pattern = QRegExp("\\b{([^}]+)}");
rule.format = functionFormat1;
highlightingRules.append(rule);
functionFormat1.setFontItalic(false);
functionFormat1.setForeground(Qt::green);
rule.pattern = QRegExp("\\b{[^}]*}");
rule.pattern = QRegExp("\\(([^)]+)\)");
rule.format = functionFormat1;
highlightingRules.append(rule);
and i tried this one also for parenthesis , but this again not working :
rule.pattern = QRegExp("\\b{[^}]*}");
Bookmarks