Username: 
Password: 
Restrict session to IP 

Level 3  Go to the Training: Regex challenge

1 2
Global Rank: 13185
Totalscore: 185
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 12y 53d
Last Seen: 12y 47d
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?
Global Rank: 253
Totalscore: 87267
Posts: 1635
Thanks: 1338
UpVotes: 886
Registered: 16y 63d




Last Seen: 2d 16h
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.
Global Rank: 13185
Totalscore: 185
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 12y 53d
Last Seen: 12y 47d
The User is Offline
RE: Level 3
Google/translate2Thank You!2Good Post!0Bad Post! link
Thanks
Global Rank: 11953
Totalscore: 307
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 11y 276d
Last Seen: 11y 265d
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?
Global Rank: 253
Totalscore: 87267
Posts: 1635
Thanks: 1338
UpVotes: 886
Registered: 16y 63d




Last Seen: 2d 16h
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.
Global Rank: 11953
Totalscore: 307
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 11y 276d
Last Seen: 11y 265d
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
Global Rank: 6189
Totalscore: 2020
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 13y 111d
Last Seen: 3y 303d
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.
Global Rank: 253
Totalscore: 87267
Posts: 1635
Thanks: 1338
UpVotes: 886
Registered: 16y 63d




Last Seen: 2d 16h
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.
Global Rank: 6189
Totalscore: 2020
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 13y 111d
Last Seen: 3y 303d
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.
Global Rank: 196
Totalscore: 107350
Posts: 14
Thanks: 12
UpVotes: 7
Registered: 11y 241d



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 74570 times.