Username: 
Password: 
Restrict session to IP 

Level4 again  Go to the Training: Regex challenge

Global Rank: 4162
Totalscore: 4385
Viestit: 10
Kiitos: 6
Plus äänet: 7
Rekisteröitynyt: 11y 101d
fuzzy`n Avatar
Viimeksi nähty: 8y 66d
Käyttäjä ei ole paikalla
Level4 again
Google/käännä0Kiitos!0Hyvä viesti!0Huono viesti! linkki
/^wechall4?(?=\.(jpg|gif|tiff|bmp|png)$)/


Can you help me find why this regex is incorrect?
Are there any incorrect cases which can bypass it?

I've tested it and it captures only filename (with or without 4) and only with specified extension.

Thanks for help! Smile
Global Rank: 7564
Totalscore: 1247
Viestit: 2
Kiitos: 2
Plus äänet: 2
Rekisteröitynyt: 11y 107d
Viimeksi nähty: 8y 212d
Käyttäjä ei ole paikalla
RE: Level4 again
Google/käännä1Kiitos!1Hyvä viesti!0Huono viesti! linkki
It doesn't capture filename, it matches filename and extension and additionally captures extension without the dot. You must to capture filename and only filename.

Edit.
Seems that you tested it wrong. ;)
Viimeksi muokannut pskosinski - Maaliskuu 14, 2013 - 00:12:29
Global Rank: 536
Totalscore: 47145
Viestit: 37
Kiitos: 21
Plus äänet: 24
Rekisteröitynyt: 11y 254d
stormsurfer`n Avatar



Viimeksi nähty: 7y 10h
Käyttäjä ei ole paikalla
RE: Level4 again
Google/käännä0Kiitos!2Hyvä viesti!0Huono viesti! linkki
what do you mean capture? what is the differenct between capture and matches?
Global Rank: 754
Totalscore: 33866
Viestit: 9
Kiitos: 7
Plus äänet: 6
Rekisteröitynyt: 12y 14d
Viimeksi nähty: 10y 170d
Käyttäjä ei ole paikalla
RE: Level4 again
Google/käännä2Kiitos!2Hyvä viesti!0Huono viesti! linkki
i see two problems whith your regex:
- you have two groups. one should be enough...
- how do you start a non-capturing group? hint: it's not ?=

capturing is done using capturing groups. that means if a string matches the pattern, then parts of that string can be captured using capturing groups...
Global Rank: 4162
Totalscore: 4385
Viestit: 10
Kiitos: 6
Plus äänet: 7
Rekisteröitynyt: 11y 101d
fuzzy`n Avatar
Viimeksi nähty: 8y 66d
Käyttäjä ei ole paikalla
RE: Level4 again
Google/käännä1Kiitos!1Hyvä viesti!0Huono viesti! linkki
Finally completed this task. Thanks for help guys! Smile
Global Rank: 13803
Totalscore: 151
Viestit: 1
Kiitos: 0
Plus äänet: 0
Rekisteröitynyt: 7y 2d
Viimeksi nähty: 5y 225d
Käyttäjä ei ole paikalla
RE: Level4 again
Google/käännä0Kiitos!0Hyvä viesti!0Huono viesti! linkki
Lainaus käyttäjältä sutupud
Maaliskuu 14, 2013 - 01:29:32

i see two problems whith your regex:
- you have two groups. one should be enough...
- how do you start a non-capturing group? hint: it's not ?=

capturing is done using capturing groups. that means if a string matches the pattern, then parts of that string can be captured using capturing groups...


Why isn't it "?="?
My regex works fine on online demos, but I can't just get it to work on this challenge
"?:" Doesn't seem to have any effect on those demos
Redknee, AIHAPPLE, zhukeni, alibaba2024, tunelko, silenttrack, n0tHappy, stormsurfer, quangntenemy, TheHiveMind, Z, balicocat, Ge0, samuraiblanco, arraez, jcquinterov, hophuocthinh, alfamen2, burhanudinn123, Ben_Dover, stephanduran89, braddie0, SwolloW, dangarbri, kalungmas on lisännyt aiheen seurantalistalle ja vastaanottaa sähköpostia uusista viesteistä.
1 ihmistä katsoo aihetta tällä hetkellä.
Tätä aihetta on katsottu 9209 kertaa.