PicoCTF - MatchTheRegex
Description: How about trying to match a regular expression?
The homepage consists of an input box where we can try putting our regular expression, aka regex, to try and match the flag:
When trying
testas a test to see how this works we get awrong match! Try again!message:We could try a site like regex101 and build a regex that match the general picoCTF flag structure, such as the following:
Unfortunately, that did not work. We can take a look at the page’s source code:
As it seems it only needs a string sequence that matches the pattern in the comment, i.e.,
^p.....F!?:- We need a sequence starting with the letter
p(^p). - Followed by any 5 characters (
.....). - Followed by the letter
F(F). - And we can have an exclamation mark (or not) at the end (
!?). The?signifies that the preceded character is optional.
So any string sequence that matches the above pattern will give us the flag:
- We need a sequence starting with the letter
This post is licensed under CC BY 4.0 by the author.








