« first day (1556 days earlier)      last day (942 days later) » 

4:20 AM
I can afford the arrogance to tell someone they try to use regex for something that can't be parsed though it. For everything else, there are try-it websites.
some regex are also code worthy of importing a third party enclosure.
I believe there is some trauma associating regex with the way they are taught. Fundamentally though they are efficient problem solvers.
 
 
9 hours later…
1:16 PM
Specifically for html it is quite a PITA, though.
I probly could've made it work, via atomic grouping, but there reaches a point where you're using regex out of stubbornness, rather than good code.
 
2:01 PM
You can't make regex for html bc it's not a regular language. Like for example you can't check if something is well parenthesized through a regex.
 
@ArthurHv there's a SE meme about that....
 
In this case, because it was very specific html that I was generating, I coulda done it. But it'd be gross.
@JourneymanGeek Scroll up a bit. :P
 
SO IT HAS COME TO THIS....
 
Ok maybe in subsets you can always manage dirty tricks
 
Yeahr.
 
2:03 PM
I know why your colleagues would hate you if you do this though
 
Specifically, I was turning an IEnumerable of ints (say, 2, 4, 8) into:
"<a href='myLongUrl/2'>2</a>, <a href='myLongUrl/4'>4</a> and <a href='myLongUrl/8'>8</a>".
 
This would be like idk choosing C to implement an html webesrver
Or even Java to implement a program
 
At first I was using Regex.Replace but I figured it was better to give up and just:
var commaSeparated = string.Join(", ", hyperlinks);
var lastCommaIndex = commaSeparated.LastIndexOf(",", StringComparison.Ordinal);
var formatted = commaSeparated.Remove(lastCommaIndex, 1).Insert(lastCommaIndex, " and");
@ArthurHv Ha! That was my primary lang back in uni.
 
2:40 PM
i knew it. All pms ever use java
 
Wow racist!
(PMs are too a race. Probably.)
 
2:54 PM
hmmm
 

« first day (1556 days earlier)      last day (942 days later) »