[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Shit to do with regex

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 16
Thread images: 4

File: regex-cheatsheet-updated.png (98KB, 700x495px) Image search: [Google]
regex-cheatsheet-updated.png
98KB, 700x495px
Well? What can it be used for?
I'm not a company, I don't have to sort through emails and shit, is it actually practical from a hobbyist standpoint?
>>
>>61086391
bump
>>
File: vimcheatsheet_web_preview.png (320KB, 1979x1346px) Image search: [Google]
vimcheatsheet_web_preview.png
320KB, 1979x1346px
i use it crawl websites for phone numbers and emails for my buisness, and also for editing large amounts of html files, i don't know many other uses but regex is a nifty skill
>>
>>61086391
Data validation, extracting a relevant part from user input, etc
>>
>>61086391
Website crawling
Data validation
User input validation
Tokenization/parser generation

My most recent use was a parser that validates input like '5d2h' and returns 5 days and 2 hours in seconds for semi-scheduled actions
>>
I used regex yesterday and it wasn't even in a script. Gedit's find and replace allowed me to use regex to clean up the formatting of some text files. Like by removing everything in brackets, for instance.
>>
Still business related, but I use it constantly for turning the sewage that powershell outputs into csv files that excel can read.

inb4 any m$ shrill content. I know, I don't need to be reminded.
>>
>>61086391
I like regex because it's incredible powerful and lets me save time almost every day, even when I'm not at work and just searching/replacing.

I had a couple of weeks of down-time at my last job because they were going through a merger, so I wrote a little tool to standardize the filenames of 15 years of scanned financial records. Felt good man.
>>
File: snails-three.png (294KB, 1439x1271px) Image search: [Google]
snails-three.png
294KB, 1439x1271px
>>61090435
I'll just add that there are some differences between the various implementations of regex. JS and .NET have slight but important differences. I use it a lot in notepad++

It also allows me to feel smug that there are people who can't read simple shit I write because I'm incredibly petty like that. I do write comprehensive comments though.
>>
Bump because regex is regsex
>>
File: 1491241951171.gif (902KB, 500x494px) Image search: [Google]
1491241951171.gif
902KB, 500x494px
>>61086391
well I just used it to grep through my history to see what I had used grep for earlier
>>
>>61090358
Powershell has Export-Csv. If you're trying to parse CONSOLE output from cmdlets or functions you're doing it wrong.
>>
>>61092562
When will cmdlets learn
>>
>>61086391
*? isn't supported by every implementation
>>
>>61086391
There is a page that makes It Very easy. Cant recall the name now. But when i get home i link It.
>>
>>61086391
>Well? What can it be used for?
Parsing regular grammars.
>I'm not a company, I don't have to sort through emails and shit, is it actually practical from a hobbyist standpoint?
Imagine you just illegally ripped thousands degenerate hentai animuh and rare pepes, but your file names contain a hash code like c984v308vmssdf between the actual movie name and file extension.
You can write a regex to rename all files and remove the hash.
Thread posts: 16
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.