« first day (633 days earlier)      last day (3159 days later) » 

2:36 AM
 
 
12 hours later…
2:11 PM
Hi Guys
Any chance of help on this? stackoverflow.com/questions/27228427/…
Solution provided by Avinash doesn't seem to work in Sublime Text 3. I'm guessing that was my fault for not making it clear originally that the string is part of a lot more.
 
@Ciwan TL;DR: "complex" nope not going to even try
 
What does TL;DR mean?
 
I have made this letter longer than usual, because I lack the time to make it short — Blaise Pascal (Warning: this page is self-referential) Overly long unformatted statements present fellow editors with a dilemma: spend excessive time parsing out what a writer meant or be mildly rude by not actually reading what was written. It is generally held by editors that lengthy writing is a sign that the writer didn't take an extra few moments to distill their thoughts into reasonably-sized pieces, giving rise to the shorthand tl;dr which indicates that the piece in question is being protested. Tr...
I have no idea what you're asking in the question. There are test cases, but they do not define what you need.
Simply put, since the specifications are "please turn A to B" the answerers are only guessing for a solution, with no understanding of what you're actually wanting to do.
 
Just saw. Thanks. Are you saying because my question is not complex enough, you won't even try? :/
 
No, because your question includes the word "complex". I don't care about things that anyone even considers complex - If they don't know regex and thus find replacements complicated, then they shouldn't do regex. Nothing to see here, move along. If they know regex and still find the replacement complicated, then it's way out of my league. Nothing to see here, move along.
 
2:27 PM
Ah I see.
Turning A to B is what I want to acheive, but I do not know how. I've tried, but couldn't.
See this [ pastebin.com/b8dMQCFt ] << that is what I have.
 
Avinash's solution works.
 
Avinash's solution does not work when that string sits among other text.
 
Turning A to B does not guarantee turning C to D.
 
True, but
If the pattern is:
You can assume a RegEx would work all over where it is matched! It isn't a guarantee, but I'd take it
 
See, that's what you need, instead you threw out test cases that do not define them.
Regex'es are not magic, they replace substring A to substring B, period.
Or both A and C to B, but in this regard the regex can treat both A and C as A.
It's also a finite state machine, so it can't do ridiculous stuff like nesting thing unless you put together a ~60 byte.
 
2:33 PM
You're right. From what I can tell, you go about it in a very structured, academic way. Which is great, cause that is how it should be. I wish I had your knowledge of RegExes so that I may define the test/condition instead of providing a string test case.
I suppose I can define it in words, but not in RegEx notation.
 
You said you wanted a regex that converts "Description":"<br><br><br> <table border... to "Description":"NHS Ne.... The solution is there. If the regex is not of the behaviour you expect, ask for that behaviour and throw away this question. The answers do work. They do. They do. They do. REGEX DEMO They do. Now, can you tell me what you want?
As in what the regex has to do, not from A to B, instead substrings like X.
 
Ok let me try ...
In strings similar (as in follow the structure) to this pastebin
 
What do you expect to get out of it and why?
 
I would like a RegEx that would change ...
"Description":"<br><br><br> <table border=\"1\" padding=\"0\"> <tr><td>CCGcode</td><td>08N</td></tr> <tr><td>CCGname</td><td>[VARIABLE]</td></tr>"
to ..
"Description":"[VARIABLE]"
Why? Because I am using D3.js to read that JSON file and display a tooltip with that name on hover on an svg map.
 
What's the reasoning? The presence of <td>...</td>? The fact that <br> exists, and we ditch 106 characters after that?
 
2:39 PM
The extra html markup make it difficult to style that tooltip, not to mention it isn't needed in there.
Why that markup exists there ... I have no idea. I got this file from the NHS website as a KML file. I've no idea why the NHS programmer though it a good idea to have that junk in there.
thought *
Perhaps had a need for it on his (NHS's) own system.
I can link you to where I got the KML if you're interested :)
 
Then use this:
s!^("Description":").*<td>([^<>\n]*).*$!$1$2"!
Hey @CSᵠ!
 
Thanks, but that can't be found (according to ST3). :/
 
hey
 
Hi CS
 
What do you think about unihedron.tk?
Looking for criticism about the theme, etc. And the markdown parser is broken.
 
2:44 PM
.tk, justify
 
It's free until I bother registering one from the github student package credits.
Actually .tk domain names are free if you sign up for one, so I went with that for quite a while now.
 
On unihedron.tk links in header don't work?
 
justify everything
 
Oh god, the links really don't work.
 
lol
 
2:46 PM
:)
When I inspect source though, I can see that the link is there, it just doesn't go through to GitHub (I'm on Chrome / Win 8)
 
dude... write it in html
or... <pre> and style that
 
It's in HTML5!
The banner has to be in its own file so it follows you when you scroll.
 
@Unihedron markdown?
any 'blog' post?
 
You really want one? I'll write one then.
 
@Unihedron see test > regex101.com/r/sC7gE7/1
 
2:53 PM
@Ciwan You're aware that "s" stands for substitution, and "!" is the delimiter, so "s!^("Description":").*<td>([^<>\n]*).*$!$1$2"!" stands for "^("Description":").*<td>([^<>\n]*).*$" -> "$1$2"", right?
 
I was not! :/
I am now though
Thanks. Let me go and try.
 
what are you doing btw?
@Unihedron :)
 
Post published. Maybe feeds will update soon. I don't know.
 
but there's no html in that json
that's a good test
 
Heh, since updateperiod in the feeds subscription xml is set to "hourly", you might see it in seven minutes or so.
 
2:57 PM
so.. where's the blog post? permalink?
 
@CSᵠ on your revision, you're also getting a no-match correct?
 
no html in json, right @Ciwan
 
But in the test string, there is HTML ... :/
 
lemme look
what do you want to match? @Ciwan
 
3:00 PM
22 mins ago, by Ciwan
I would like a RegEx that would change ...
Read the conversation around there.
 
I would like a RegEx that would change ...
"Description":"<br><br><br> <table border=\"1\" padding=\"0\"> <tr><td>CCGcode</td><td>08N</td></tr> <tr><td>CCGname</td><td>[VARIABLE]</td></tr>"
to ..
"Description":"[VARIABLE]"
 
@Unihedron 13yo or so?
really?
 
@CSᵠ Jack's 13 year old.
I'm obviously 17.
 
:)
 
Or 16, depending on whether my memory is failing me.
 
3:01 PM
posted on December 01, 2014 by Unihedron

I’ve noticed a problem with most JSON parser libraries in Java, which is that the content are broken down eagerly without caching. Since the string objects comes through requests and get broken down pretty quickly at the end lots of String garbage is made. I want to write a JSON parser library that lazily retrieves corresponding … →

 
cool
!
^^
 
Oh cool, it's 1 Dec already!
I have 7k helpful flags, 4k flags felt like yesterday.
 
i have 512 flags, and don;'t wanna flag any more
i don't want to ruin that beautiful number
 
@Unihedron now that you know what it is that I am trying to achieve, how would you define the condition/test?
 
almost flagged a few things the other day
 
3:05 PM
@Ciwan I actually don't understand what you're trying to achieve. The test case is there all right, but it's not clear how you expect to extract the content where similar substrings exist. There's no uniqueness that identifies [VARIABLE], and you never clarified that.
 
hmm if were to say it in words, I'd say ...
leave
"Description":"
then delete everything till you get to the last <td>
 
Where "Description" is "Description" or any number of alpha?
 
Yes, where "Description" is "Description"
 
Had you mentioned you wanted the string behind the last <td> we could had completed this 50 minutes ago and went home.
 
3:11 PM
@Unihedron almost 3k steps....
looks like that:)
 
Must I optimize it? Sure.
 
Thanks guys :)
 
you welcome
 
293 steps @CSᵠ regex101.com/r/sC7gE7/5
 
regex101.com/r/sC7gE7/3 75 steps @Unihedron
 
3:16 PM
@CSᵠ There are so many ways it can screw up.
 
but will it?
 
Of course, since you hardcoded "CCGname" into the regex.
It doesn't achieve the expected behaviour, instead gets whatever non-< characters starting with uppercase and followed by CCGname.
 
not sure this requires a general sollution
looks like it's pretty fixed and follows a clear pattern
 
Me neither.
 
so both of out solutions work, as would the other 1000 possible :)
variations of course :D
 
3:22 PM
13
Q: Quality problems in regex answers

Justin MorganI've been hanging out in the regex tag a lot lately, and I've noticed something I don't see as much in my other favorites (C#, LINQ, and a couple others): A disturbing number of regex answers are deeply, deeply wrong. I've posted about this before, but I thought that was an isolated incident or a...

> No, I'm talking about severe, fundamental problems with an answer. People are ignoring key points of a question, or posting a small change to the OP's pattern that does nothing to address the issue, or tossing out some mangled regex that shows a serious lack of thought or understanding.
@CSᵠ ಠಿ_ಠ
 
yeah... anyway, anything you maybe want to spell out?
 
No, not really. That's just to show you that many other users share my concern of answers giving arbitrary requirements to work around general solutions.
 
5
A: RegExp for validating PRICE

CSᵠRegEx for validating Price Fields: /^(\d*([.,](?=\d{3}))?\d+)+((?!\2)[.,]\d\d)?$/ Explained demo: http://regex101.com/r/uG5lI0 Will validate only if in correct format, with dots or commas in their respective places. International format for the en_US locale & US national format: 134.56 ...

 
It looks surprisingly like the regex quiz on freenode #regex channel.
 
linjk
 
3:29 PM
Awesome! I want ,,,,,,,, dollars, please. — Jack Maney Apr 11 '13 at 21:08
Hahahaha...
 
lol, yeah!
 
No catastrophic backtracking?
Do you do PHP @CSᵠ?
 
yes uni
 
Is it important for MySQL (or alike databases) to be present for PHP to reach a reasonable potential?
 
not sure about your question
you can have databaseless websites
or scripts
 
3:34 PM
Oh. Well, when I use MySQL, it often works best with PHP webpages. So I wonder if PHP works best with MySQL.
 
:) LAMP is a common stack
 
 
2 hours later…
5:41 PM
@HamZa @HamZa I didn't know that, thanks for sharing
 
 
3 hours later…
8:56 PM
welcome
@Unihedron lolz
 

« first day (633 days earlier)      last day (3159 days later) »