|
-
Jan 31st, 2004, 05:34 PM
#1
Thread Starter
yay gay
reg expressions
I have to find folders that have the following sintax:
[100% Complete]-[100% Damaged]-[7 Tracks@38MB]-[LastCheck 31-01-2004]
so..
[xxx Complete]-[xxx Damaged]-[xxx Tracks@xxMB]-[LastCheck xxx]
I dont know anything about reg expressions, could anyone help me out?
\m/  \m/
-
Jan 31st, 2004, 06:18 PM
#2
Hi.
Try something like this:
[[][0-9].*?% Complete[]]-[[][0-9].*?% Damaged[]]-[[][0-9].*? Tracks@[0-9].*?MB[]]-[[]LastCheck [0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][]]
This might need some tweaking, because "100%" and "1 0 0 %" will both succed, so it's not foolproof, but it will match the string in your post.
BTW: you might wan't to look at www.regular-expressions.com.
They have a very good tutorial on RegEx.
Hope it helps.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Jan 31st, 2004, 06:25 PM
#3
Thread Starter
yay gay
Well much tks, ill try it and will read the tuturial too as i want to be able to do it next time for myself
\m/  \m/
-
Jan 31st, 2004, 07:37 PM
#4
Thread Starter
yay gay
could you change it for
[86,3% Complete]-[0 Damaged]-[7 Tracks@33MB]-[LastCheck 01-02-2004]
please? I'm reading the tuturial in the meantime..
thanks!
\m/  \m/
-
Feb 1st, 2004, 10:10 AM
#5
Thread Starter
yay gay
\m/  \m/
-
Feb 1st, 2004, 02:26 PM
#6
Hi.
I believe this ought to do it.
[[][0-9].*?% Complete[]]-[[][0-9].*? Damaged[]]-[[][0-9].*? Tracks@[0-9].*?MB[]]-[[]LastCheck [0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][]]
The only change is actually to % before the "Damaged" part.
Now it just checks that after the complete part, there should be a number. After that it accepts everything repeatedly until it see a space.
the ".*?" means that all characters are accepted and repeated until the it meets the character after the ?-mark.
Hope you can use it.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|