Username: 
Password: 
Restrict session to IP 

Level 3  Go to the Training: Regex challenge

1 2
Global Rank: 13489
Totalscore: 194
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 12y 304d
Last Seen: 12y 298d
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: 227
Totalscore: 94360
Posts: 1684
Thanks: 1360
UpVotes: 920
Registered: 16y 314d




Last Seen: 1d 10h
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: 13489
Totalscore: 194
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 12y 304d
Last Seen: 12y 298d
The User is Offline
RE: Level 3
Google/translate2Thank You!2Good Post!0Bad Post! link
Thanks
Global Rank: 12211
Totalscore: 319
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 12y 161d
Last Seen: 12y 151d
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: 227
Totalscore: 94360
Posts: 1684
Thanks: 1360
UpVotes: 920
Registered: 16y 314d




Last Seen: 1d 10h
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: 12211
Totalscore: 319
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 12y 161d
Last Seen: 12y 151d
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: 6286
Totalscore: 2026
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 13y 362d
Last Seen: 4y 189d
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: 227
Totalscore: 94360
Posts: 1684
Thanks: 1360
UpVotes: 920
Registered: 16y 314d




Last Seen: 1d 10h
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: 6286
Totalscore: 2026
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 13y 362d
Last Seen: 4y 189d
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: 194
Totalscore: 107360
Posts: 14
Thanks: 12
UpVotes: 7
Registered: 12y 127d



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, alibaba2024, tunelko, silenttrack, n0tHappy, nonfungiblesecurity, quangntenemy, TheHiveMind, Z, balicocat, Ge0, samuraiblanco, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89, braddie0, SwolloW, dangarbri, csuquvq 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 77211 times.