July 25, 2011

Peppy Peppy
Hobby Entomologist
389 posts

QRegExp - how to parse (G)UID?

 

I mean, that my application will have to parse (G)UID with this syntax:

  1. {[0-9A-F]{8}-[0-9A-F]{8}-[0-9A-F]{8}-[0-9A-F]{8}}

What is wrong in this regexp ?

7 replies

July 25, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

Maybe you need to escape { ?

  1. \{[0-9A-F]{8}-[0-9A-F]{8}-[0-9A-F]{8}-[0-9A-F]{8}\}

July 25, 2011

Peppy Peppy
Hobby Entomologist
389 posts

No. Doesn’t work…

July 25, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

As Wikipedia says GUID has another format.
This should help you

  1. \{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}

And don’t forget that you need to double \ in C++ code.

July 25, 2011

Peppy Peppy
Hobby Entomologist
389 posts

Well, doesn’t matter about format. I don’t have any clue about QRegExp (cause it requires training)…

July 25, 2011

mlong mlong
Mad Scientist
1517 posts
Peppy wrote:
Well, doesn’t matter about format. I don’t have any clue about QRegExp (cause it requires training)…

What do you need to know? It’s pretty straightforward. Anything specific we can help you with?

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

July 25, 2011

Peppy Peppy
Hobby Entomologist
389 posts

Yes. It has something like order of commands, order of parsing or something like that, how it works…then I will understand it…how it works…

July 25, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

I think that you need to read something like this [regular-expressions.info]

 
  ‹‹ [Solved] QTableView - keep 1st column fixed size and non-scrollable      Reimplementing winEvent: getting stuck in API call ››

You must log in to post a reply. Not a member yet? Register here!