LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

regex making my head spin...

Perhaps this is more readable?  At least it's more clear that there are multiple searches being performed.

 

19037i08933775058E9823

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 11 of 17
(1,289 Views)

I am sure the logic of the regex is sound, and it is too early on the West Coast to wrap my head around it anyway.  What I find makes them a bit more readable (and it could just be me) is the use of character classes:

 

I would slightly modify the regex as follows:

 

((: *)*[\d ]{0,1}(1(\D*)6))|(1( *\w*\s\d* *: *)6)

 

\d is digit [0-9]

\D is everything except [0-9]

\w is a word character

\s is whitespace

Message 12 of 17
(1,263 Views)

I can't be sure, but I think you guys are cursing at each other. Smiley Very Happy

Message 13 of 17
(1,258 Views)

It gets more readable the longer I look at it. 

 

19065i062E0FAFD39F954C

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 14 of 17
(1,253 Views)

Hate to break it to you guys, but I decided to go with string parsing rather than regexp. This is actually for C++ not LabVIEW but I figured for something so generic, this would be a good place to ask. Solutions come quickly here! Either way, the solutions were interesting, well thought out, and well explained. Kudos to come when I have some free time.

0 Kudos
Message 15 of 17
(1,224 Views)

 


@for(imstuck) wrote:

Hate to break it to you guys, but I decided to go with string parsing rather than regexp.


\w[a-z@#]+ You!     Smiley Very Happy

 

Message 16 of 17
(1,223 Views)

I posted my last version, along with an explanation of its regexp, over here.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 17 of 17
(1,201 Views)