[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
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 21
Thread images: 6
File: 1412843268742.jpg (55 KB, 957x621) Image search: [Google]
1412843268742.jpg
55 KB, 957x621
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 (873 KB, 770x775) Image search: [Google]
yee.png
873 KB, 770x775
>>55615325
>>
>>55615316
Nice regex solution you got there. That's some really intellectual shit
>>
>>55615360

(regex | intellectual)
>>
File: alexandra.png (51 KB, 179x156) Image search: [Google]
alexandra.png
51 KB, 179x156
>>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 (843 KB, 1775x1618) Image search: [Google]
notmlp.jpg
843 KB, 1775x1618
>>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 (14 KB, 585x409) Image search: [Google]
it werks.png
14 KB, 585x409
Try my solution
>>55615416

Proof attached.
>>
>>55615291
>still using RegEx
>2006
>>
File: 1467471051704.gif (177 KB, 180x218) Image search: [Google]
1467471051704.gif
177 KB, 180x218
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

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.