[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

Does anyone on /g/ know regex? I have this string and need to remove everything except


Thread replies: 21
Thread images: 6

File: 1412843268742.jpg (55KB, 957x621px) Image search: [Google] [Yandex] [Bing]
1412843268742.jpg
55KB, 957x621px
Does anyone on /g/ know regex? I have this string and need to remove everything except "Pepeman, hueman", "Spiderman" and "Moot".

Pepeman, hueman A B C  Spiderman B D  Moot EF  MON-FRI,-,


Currently I have 8 lines of shitty Java replace and replaceAll statements but i would like something more clean
>>
>>55615291
Your replace and replaceAll statements are probably more clean than the regex.
>>
>>55615291
https://regex101.com/
>>
OH SHIT IS GOOGLE DOWN?

But seriously, go to regexone and actually learn regex. Seriously worth the effort.
>>
>Being this retarded

I really wonder what goes on in your mind, like are you really that stupid or are you just lazy? Can't you use your brain?
>>
>>55615316
>Can't you use your brain?
no
>>
File: yee.png (873KB, 770x775px) Image search: [Google] [Yandex] [Bing]
yee.png
873KB, 770x775px
>>55615325
>>
>>55615316
Nice regex solution you got there. That's some really intellectual shit
>>
>>55615360

(regex | intellectual)
>>
File: alexandra.png (51KB, 179x156px) Image search: [Google] [Yandex] [Bing]
alexandra.png
51KB, 179x156px
>>55615315
It's been down 3 times so far. Has been back up a few minutes later though.

I only had problems with /g/mail though, not the search engine.
>>
>>55615291
s/(Pepeman, hueman).*(Spiderman).*(Moot).*/\1 \2 \3/
>>
(((Pepe|hue|Super)man)|Moot)

I think
>>
>>55615384
Yeah, that's totally wrong. Pepeman, hueman, spuderman and moot can be anything. Only A B C D EF MON-FRI are static
>>
>>55615413
([A-Z]{1,3} )|([A-Z]{3}.*)
>>
>>55615291
use a gui tool retarded winbabby

http://www.den4b.com/?x=products&product=renamer
>>
File: notmlp.jpg (843KB, 1775x1618px) Image search: [Google] [Yandex] [Bing]
notmlp.jpg
843KB, 1775x1618px
>>55615291
echo 'Pepeman, hueman A B C  Spiderman B D  Moot EF  MON-FRI,-,' |sed -r -e 's/[A-Z][^a-z]//g' -e 's/\s[^a-zA-Z ]+//g'

output:
Pepeman, hueman  Spiderman  Moot
>>
File: it werks.png (14KB, 585x409px) Image search: [Google] [Yandex] [Bing]
it werks.png
14KB, 585x409px
Try my solution
>>55615416

Proof attached.
>>
>>55615291
>still using RegEx
>2006
>>
File: 1467471051704.gif (177KB, 180x218px) Image search: [Google] [Yandex] [Bing]
1467471051704.gif
177KB, 180x218px
short:
sed -r -e 's/[A-Z][^a-z]//g' -e 's/\s[^a-zA-Z ]+//g'
>>
>>55615416
>>55615478
Thank you Anon, here's 3 indian dollars
>>
>>55615506

>sed


dumb nigger
Thread replies: 21
Thread images: 6
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK