Username: 
Password: 
Restrict session to IP 
Online within 1d

Level 3  Go to the Training: Regex challenge

1 2
Global Rank: 14246
Totalscore: 201
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 14y 248d
Last Seen: 14y 242d
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: 198
Totalscore: 110647
Posts: 1795
Thanks: 1390
UpVotes: 961
Registered: 18y 258d




Last Seen: 64d 15h
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: 14246
Totalscore: 201
Posts: 5
Thanks: 10
UpVotes: 11
Registered: 14y 248d
Last Seen: 14y 242d
The User is Offline
RE: Level 3
Google/translate2Thank You!2Good Post!0Bad Post! link
Thanks
Global Rank: 12920
Totalscore: 328
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 14y 106d
Last Seen: 14y 95d
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: 198
Totalscore: 110647
Posts: 1795
Thanks: 1390
UpVotes: 961
Registered: 18y 258d




Last Seen: 64d 15h
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: 12920
Totalscore: 328
Posts: 2
Thanks: 0
UpVotes: 0
Registered: 14y 106d
Last Seen: 14y 95d
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: 6614
Totalscore: 2031
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 15y 306d
Last Seen: 6y 133d
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: 198
Totalscore: 110647
Posts: 1795
Thanks: 1390
UpVotes: 961
Registered: 18y 258d




Last Seen: 64d 15h
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: 6614
Totalscore: 2031
Posts: 5
Thanks: 4
UpVotes: 4
Registered: 15y 306d
Last Seen: 6y 133d
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: 158
Totalscore: 128007
Posts: 14
Thanks: 12
UpVotes: 7
Registered: 14y 71d




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, silenttrack, n0tHappy, nonfungiblesecurity, quangntenemy, TheHiveMind, Z, balicocat, Ge0, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89, braddie0, fpombal, 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 78890 times.

PHP Fatal Error(1): Constant E_STRICT is deprecated since 8.4, the error level was removed in www/protected/config.php line 6


Backtrace starts in [unknown file] line ?. GWF_Debug::shutdown_function() core/inc/util/GWF_Debug.php line 109. GWF_Debug::error_handler().... core/inc/util/GWF_Debug.php line 180.