Nom d'utilisateur: 
Mot de passe: 
Restreindre la session à cette IP 

Level 3  Go to the Training: Regex challenge

1 2
Classement Général: 13208
Total de Points: 185
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 12y 64d
Last Seen: 12y 58d
The User is Offline
Level 3
Google/translate2Thank You!2Good Post!0Bad Post! link
I'm sorry for posting so much, but I just can't seem to understand why my answer is being rejected in level 3.

This is the assignment:
Your pattern shall match all images with the name wechall.ext or wechall4.ext and a valid image extension.
Valid image extensions are .jpg, .gif, .tiff, .bmp and .png.

And I get this error:
Your pattern would match "wechall.jpg ", but it should not match it.

But from the explanation it seems to me that it should match it. Could someone explain this to me?
Classement Général: 253
Total de Points: 87266
Posts: 1639
Thanks: 1339
UpVotes: 887
Registered: 16y 74d




Last Seen: 1d 9h
The User is Offline
RE: Level 3
Google/translate1Thank You!0Good Post!1Bad Post! link
The challenge also checks against "wechall.jpg "
Note the whitespace at the end of this checked filename.

Cheers
gizmore
The geeks shall inherit the properties and methods of object earth.
Classement Général: 13208
Total de Points: 185
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 12y 64d
Last Seen: 12y 58d
The User is Offline
RE: Level 3
Google/translate2Thank You!2Good Post!0Bad Post! link
Thanks
Classement Général: 11970
Total de Points: 307
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 11y 286d
Last Seen: 11y 276d
The User is Offline
RE: Level 3
Google/translate0Thank You!0Good Post!0Bad Post! link
Hi,

i'm getting reject with "Your pattern would match "wechall3.png", but it should not match it."
But my regex only allows no numbers or a 4.. i have no idea how the check can come up with a 3 allowed?! Every RegEx tests like RegEx Coach / other online Tests said it will not recognize wechall3.png..

I don't want to to post the almost complete RegEx here and i cannot sent PMs yet. But basically what i do is check for "wechall" followed by number and the "possible" operator, followed by . extension..

Does anyone knows whats going on?
Classement Général: 253
Total de Points: 87266
Posts: 1639
Thanks: 1339
UpVotes: 887
Registered: 16y 74d




Last Seen: 1d 9h
The User is Offline
RE: Level 3
Google/translate0Thank You!0Good Post!0Bad Post! link
It shall only match wechall4 and wechall, but not wechall3 ... maybe that`s the problem?
Another thing might be that . means any char, so you maybe want to escape it like \.

Maybe it helps
gizmore
The geeks shall inherit the properties and methods of object earth.
Classement Général: 11970
Total de Points: 307
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 11y 286d
Last Seen: 11y 276d
The User is Offline
RE: Level 3
Google/translate0Thank You!0Good Post!0Bad Post! link
It only checks vs the explicit 4. Not any number. Also i tried . oder \. - its no difference
Classement Général: 6194
Total de Points: 2020
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 13y 122d
Last Seen: 3y 314d
The User is Offline
RE: Level 3
Google/translate0Thank You!0Good Post!0Bad Post! link
Hello challengers.
code(bmp|png|jpg|tiff|gif)
will show:
Quote from Unknown
Your pattern would capture a string, but this is not wanted. Please use a non capturing group.

How can i pass that without () grouping?

Can you give me a link or hint for?
greets grmf.
Classement Général: 253
Total de Points: 87266
Posts: 1639
Thanks: 1339
UpVotes: 887
Registered: 16y 74d




Last Seen: 1d 9h
The User is Offline
RE: Level 3
Google/translate4Thank You!3Good Post!0Bad Post! link
use a non capturing group (?:group|here)
The geeks shall inherit the properties and methods of object earth.
Classement Général: 6194
Total de Points: 2020
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 13y 122d
Last Seen: 3y 314d
The User is Offline
RE: Level 3
Google/translate0Thank You!1Good Post!0Bad Post! link
Quote from Unknown
Correct, let`s see if you can come up with a pattern for the next problem.

Thank you! i have searched since hours but not seen that hint.
Classement Général: 196
Total de Points: 107345
Posts: 14
Thanks: 12
UpVotes: 7
Registered: 11y 252d



The User is Offline
RE: Level 3
Google/translate2Thank You!1Good Post!0Bad Post! link
Here you have the definition (and difference between others) of non capturing group.
http://www.regular-expressions.info/refadv.html
Regards.
1 2
sisyang, Redknee, AIHAPPLE, zhukeni, tunelko, silenttrack, n0tHappy, quangntenemy, TheHiveMind, Z, balicocat, Ge0, samuraiblanco, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89, braddie0, JanLitwin17, SwolloW, dangarbri have subscribed to this thread and receive emails on new posts.
1 people are watching the thread at the moment.
This thread has been viewed 74604 times.