ReGeX matching game

f-droid.org/wiki/page/com.phikal.regex
this is fun but sometimes i feel like the only choice is hamfisted.

for example, using 17 characters:

Match Don't Match
pob0 gm1
Y0GH Chf4
Dhtg 5O


the only solution i could come up with was ^[pYD]\w+

can Sup Forums do better?
will post more as i get to them if there is interest

Other urls found in this thread:

regex101.com/
twitter.com/SFWRedditVideos

I don't get it

what don't you understand?
do you not know what the game/I am asking you to do?

what "regex" is

regular expression.
it says in the image.

yes but you can explain what is ^[pYD]\w+ mean?

>can explain what is ^[pYD]\w+
okay.
>^
beginning of the string
>[pYD]
match any of the characters within the brackets
>\w
match any number, letter, or underscore
>+
match the previous one or more times

You're a very patient man

does someone have a regex matching game but only for lex/flex? gotta exercise on that

^(pob0|Y0GH|Dhtg)$

>17 characters

Why would you not just use ^[pYD].*[0Hg]? It's more readable.

why would i do that?

Because it's a more straightforward answer.

how is that a more straightforward answer?

I just use this whenever I need to
regex101.com/

You take the first and last characters, then match everything between them. Add a $ at the end of the expression maybe.
What OP posted doesn't even work.

> not just running
$ echo "test1
> test2
> test3" | grep "expression"

>You take the first and last characters, then match everything between them
but that's not what i wanted to do. i just wanted to get the 3 i was supposed to.
>What OP posted doesn't even work
yes it does.

...

I mean if you have a regex like that I'd just do a "only 4 characters" one.

Unsure if syntax is correct but you can save like three characters like this

[^mf5]

works on my machine.

maybe add a * idk

Why should any non-autistic person care about this?

kill yourself

/thread

Also known as regex golf

ez