File: 1456465923632.png (1.78 MB, 1141x1277, sweden.png)
No.22336
>>22335grep (Globally search a Regular Expression and Print) was used. Same results with both extended and perl regex.
The ls commands were to show how a wildcard is used in shell, which is more likely how he was using that asterisk to begin with.
Can you show me any language/program with regex that would match " " when given "1*"?
No.22337
>>22336Actually I was just being a smart aleck in
>>22329He probably just meant a single character wildcard ("." in regex, "?" in bash) so 10-19 year olds (which would be 1[0-9] in regex :)
No.22338
>>22336>Can you show me any language/program with regex that would match " " when given "1*"?Uhh you just did in
>>22333look at the 3rd result of grep.
No.22339
File: 1456522436721.png (3.14 KB, 220x124, 2016-02-26-163022_220x124_….png)
>>22337>He probably just meant a single character wildcard ("." in regex, "?" in bash)>so 10-19 year olds>>22338grep doesn't work like you think it does. It shows surrounding lines and text around matches by default, you can show only matches by passing -o.
No.22340
>>22339>grep doesn't work like you think it doesI'm pretty sure it does.
>It shows surrounding lines and text around matches by defaultNo, it doesn't. It prints the entire line that matches by default, but no other lines. -o will print only the substring that matches.
'1* year old' will match ' year old'. I am 100% sure of this. I would literally bet my life on it.
No.22342
File: 1456524260085.png (10.1 KB, 604x394, 2016-02-26-170010_604x394_….png)
>>22340>>22340You're right that I'm mistaken about grep, I was thinking something odd to do with -A and -B options, and from what I assume is me misunderstanding grep for years, and got confused, but perhaps you can explain this.
Apparently all of these lines are matching in the picture, literally "<any char>*" seems to match every line in a file no matter what even if <any char> isn't even in the file, what the fuck is this?
"1*" only matches the line " year old" because "<literally anything>*" matches every single line in a file.
No.22343
>>22342"*" means you can have zero or more occurrences of the previous character (or group of characters).
You are telling grep to look for a filename that matches, say "6*" which means "any filename with a substring containing zero or more 6's". So "6" and "66" etc all match but so does "". (no character)
So the filename "hail_satan_666.txt" is printed because it contains the matching substring "666". But the filename "smoking_hot_shab.png" also matches because it has a substring of length zero containing zero 6's.
If you read about the formal definition of regular expressions you can learn all about this silly shit.
No.22347
>>22343I understand it now, thanks.
>>22346I'm not smart I'm dumb, the other guy is smart.
No.22348
File: 1456525617941.jpg (185.1 KB, 1656x1806, Lonicera_etrusca_1.jpg)
>>22347No I think you are very smart because you learned from your mistake and now you know more stuff!