this "(?<=exp)" dose not work with QRegExp:
e.g.
Qt Code:
rx.indexIn("cx ab ab xv");To copy to clipboard, switch view to plain text mode
after executing that code, "list" is empty which is wrong.
any idea?
this "(?<=exp)" dose not work with QRegExp:
e.g.
Qt Code:
rx.indexIn("cx ab ab xv");To copy to clipboard, switch view to plain text mode
after executing that code, "list" is empty which is wrong.
any idea?
anyone??
this problem is really bugging me.. still couldn't find out why QT dosent recognize "(?<=exp)"
someone delete this thread from here.. I'm posting it in "Qt Programming" sub-forum
No, you are posting here because the answer to your question is in the documentation.
since QT dose not support "independent" subexpressions in regular expression like : "(?<=exp)"
so are there any ways around it?
e.g:
Qt Code:
rx.indexIn("cx ab ab xv");To copy to clipboard, switch view to plain text mode
What is the exact effect you wish to obtain?
Also, please don't spawn multiple threads on the same or similar subject. Instead continue the old thread. Threads merged.
alright..
the thing is that:
suppose we have this string:
"blablabla : 234 : 23k 5j245 :345"
I need to get this list: "234", " 23k 5j245", "345"
(or we can say all words between ":" should be separated and last word may not end with ":")
this regular expression works fine: (?<=:\s*)[^:]*(?=(:| ))
so how do I not use "(?<=exp)" there?
nvm..
solved by using these two regular expression together:
:[^:]*(?=(:| )) and then applying to each capture with [^: ].*$
Hmm... wouldn't this be simpler?
Qt Code:
QStringList components = myWeirdString.split(":"); // or QRegExp("\s*:\s*") if you want to ignore white spacesTo copy to clipboard, switch view to plain text mode
Nik8768 (20th April 2010)
Bookmarks