Skip to content

Instantly share code, notes, and snippets.

View minusInfinite's full-sized avatar

Ashley minusInfinite

View GitHub Profile
@minusInfinite
minusInfinite / regex_tut_.md
Last active October 4, 2021 12:35
Regex Tutorial

Matching an Email using RegExp

There are a number of solution for making sure your users provide a valid email address and in some cases you need to have a solution of your own. In the following example I will demonstrate how you can use Regular Expressions (RegEx)

Summary

In this tutorial we'll be bracking down the following expression.

/^([a-z0-9_\.-]+)@([\da-z-\.]+)\.([a-z\.]{2,6})$/
@minusInfinite
minusInfinite / python_csv_newline.md
Last active August 5, 2021 11:59
Python, CSVs and Newlines

Python, CSVs and Newlines

During my day-to-day, I work with a lot of CSV like data. The data is functional when import into Excel or using RBQL via VS Code, but now and then, you will click "Text to Column", and some data moves or Excel attempt to reformat it incorrectly.

More often than I can count, I've found this is due to lines either not having the same amount of commas or a newline between quotations. Having these discrepancies can make life difficult. While manually editing these files is possible when the data set is 60,000 or more lines, time spent on manual correction is costly.

Out of curiosity, I sort a solution with Python.