Nome Utente: 
Password : 
Restringi sessione all'IP 
Online in 1gg

Level 3  Vai alla sfida "Training: Regex"

1 2
Posizione globale: 14246
Punteggio totale: 201
Posts : 5
Grazie: 10
Voti+: 11
Registrato: 14a 249gg
Ultima visita: 14a 243gg
L'utente è Offline
Level 3
Google/traduci2Grazie!2Bel post!0Brutto 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?
Posizione globale: 198
Punteggio totale: 110647
Posts : 1795
Grazie: 1390
Voti+: 961
Registrato: 18a 259gg




Ultima visita: 65gg 14ore
L'utente è Offline
RE: Level 3
Google/traduci1Grazie!0Bel post!1Brutto 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.
Posizione globale: 14246
Punteggio totale: 201
Posts : 5
Grazie: 10
Voti+: 11
Registrato: 14a 249gg
Ultima visita: 14a 243gg
L'utente è Offline
RE: Level 3
Google/traduci2Grazie!2Bel post!0Brutto post! Link
Thanks
Posizione globale: 12920
Punteggio totale: 328
Posts : 2
Grazie: 0
Voti+: 0
Registrato: 14a 107gg
Ultima visita: 14a 96gg
L'utente è Offline
RE: Level 3
Google/traduci0Grazie!0Bel post!0Brutto 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?
Posizione globale: 198
Punteggio totale: 110647
Posts : 1795
Grazie: 1390
Voti+: 961
Registrato: 18a 259gg




Ultima visita: 65gg 14ore
L'utente è Offline
RE: Level 3
Google/traduci0Grazie!0Bel post!0Brutto 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.
Posizione globale: 12920
Punteggio totale: 328
Posts : 2
Grazie: 0
Voti+: 0
Registrato: 14a 107gg
Ultima visita: 14a 96gg
L'utente è Offline
RE: Level 3
Google/traduci0Grazie!0Bel post!0Brutto post! Link
It only checks vs the explicit 4. Not any number. Also i tried . oder \. - its no difference
Posizione globale: 6614
Punteggio totale: 2031
Posts : 5
Grazie: 4
Voti+: 4
Registrato: 15a 307gg
Ultima visita: 6a 134gg
L'utente è Offline
RE: Level 3
Google/traduci0Grazie!0Bel post!0Brutto post! Link
Hello challengers.
code(bmp|png|jpg|tiff|gif)
will show:
Citazione da 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.
Posizione globale: 198
Punteggio totale: 110647
Posts : 1795
Grazie: 1390
Voti+: 961
Registrato: 18a 259gg




Ultima visita: 65gg 14ore
L'utente è Offline
RE: Level 3
Google/traduci4Grazie!3Bel post!0Brutto post! Link
use a non capturing group (?:group|here)
The geeks shall inherit the properties and methods of object earth.
Posizione globale: 6614
Punteggio totale: 2031
Posts : 5
Grazie: 4
Voti+: 4
Registrato: 15a 307gg
Ultima visita: 6a 134gg
L'utente è Offline
RE: Level 3
Google/traduci0Grazie!1Bel post!0Brutto post! Link
Citazione da 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.
Posizione globale: 158
Punteggio totale: 128007
Posts : 14
Grazie: 12
Voti+: 7
Registrato: 14a 72gg




L'utente è Offline
RE: Level 3
Google/traduci2Grazie!1Bel post!0Brutto 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 utenti hanno sottoscritto il thread e ricevo le E-Mail di notifica.
1 persone stanno visualizzando il thread.
Questo thread è stato visualizzato 78894 volte.

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.