btw, I think you reg exp is not exaclty correct, try to use this one: \d+.
btw, I think you reg exp is not exaclty correct, try to use this one: \d+.
Last edited by spirit; 27th July 2009 at 09:47. Reason: updated contents
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
I used QRegExp rx ( "(\\d+)" );
even after that also i m get the message as
Key Press EventATUM
0: 0:123.000:456.000:789.000
1: 1:321.000:654.000:987.000
2: 2:963.000:852.000:741.000
3: 3:357.000:214.000:698.000
resulttemp=::::
Please help me how to proceed further
Thanks & Regards
Sandeep G.R.
did you look at Qt Assistant, there is an example in QRegExp::search?
Qt Code:
int count = 0; int pos = 0; while ( (pos = rx.search(str, pos)) != -1 ) { count++; pos += rx.matchedLength(); } // pos will be 9, 14, 18 and finally 24; count will end up as 4To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Here i am not using fixed string,, even i went through the examples also.
The format of the file is as below and user will be writing some more values into the file maximum is 99 points and simultaneously user need to read the values.
Datum X Y Z
0 123 456 789
1 321 654 987
2 345 243 809
......
.....
...... and so on
now i need to search for Datum number i.e., first column only then i need to read the corresponding line split the Datum, X, Y, Z values and store in 3 different variables.
QRegExp rx ( "(\\d+)" );
rx.search ( "Datumno_Val" );
is my code is correct or not.
Thanks & Regards
Sandeep G.R.
if it doesn't work then it is not correct.![]()
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Then how to proceed further is there any other method to perform this operation.
Thanks & Regards
Sandeep G.R.
Bookmarks