Answer the question
In order to leave comments, you need to log in
Regular expressions. How to count the number of values separated by a character?
Hello. I'm not very good at regular expressions. I do not understand them and get confused in these patterns. I read the manuals, and now I'm even more confused.
In general, you need to somehow calculate the number of values \u200b\u200bthat are separated in a cell by a comma.
Actually, I wrote like this, but I don’t know how to determine and where to enter a comma so that it is not taken into account but considered a separator. And the variable $xR given eventually acquired a value equal to the number of occurrences, separated by a comma.
$xR = preg_match_all("/(\w+)\/",$data_point[2],$regD);
Answer the question
In order to leave comments, you need to log in
Call qmake -project
in the project folder.
Explanation : source files must be included in the pro file, above command adds/corrects source paths automatically.
Perhaps you need to install packages gcc , g++ , clang
There is such a way.
$xR = preg_match_all("/[^,]+/",$data_point[2],$regD);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question