« first day (600 days earlier)      last day (3192 days later) » 

01:03
I need a motto/slogan for the soon to be site regexdoc.com if anyone can throw some suggestions.
 
2 hours later…
03:09
fools rush to where angels fear to tread
03:31
@Unihedron "Take a deep breath."
03:47
Hmm, keep it simple "Regexdoc — Community Regular Expression QA"
04:21
To this day, anyone can answer.. who would you say are the top 3-5 regex legends that defined regular expressions?
05:20
qtax
tchrist
The legend of the little \d and it's journey in .NETland
06:19
I'm speaking in reference of people disregarding SO users.
Tim Berners Lee ?
just throwing manes around
might as well tell you about Alan Turing
Gill Bates, Jteeve Sobs
 
2 hours later…
08:13
@CSᵠ Congrats on passing the 5k rep mark
thanx
awesome number to pass it looks awesome
+1
wow, you're at 40k... i remember like it was yesterday when you were just a baby at just under 20k @Jerry
so fast you grew up
kids...
:P
08:44
lol, yesterday? xD I was around 38k-39k for the longest time ever. I kind of got less active this year compared to the previous
09:00
my memories go way back :)
 
3 hours later…
user652649
12:23
morning pals
user652649
5
Q: Regular Expression for validating DNS label ( host name)

RwahyudiI would like to validate a hostname using only regualr expression. Host Names (or 'labels' in DNS jargon) were traditionally defined by RFC 952 and RFC 1123 and may be composed of the following valid characters. List item A to Z ; upper case characters a to z ; lower case characters 0 to 9 ;...

I'm too new on this site for any shared memories. :P
user652649
:P i'm trying to understand the answers
user652649
don't get how "must not be only digits" is checked
you mean on the accepted answer?
user652649
12:33
the js one
user652649
/^(?![0-9]+$)(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$/
user652649
actually i don't get most of it
What's so ununderstandable about it?
user652649
@Unihedron pretty much everything?
user652649
[0-9]+$ what's the $ there?
12:35
Isn't all digits + doesn't end with - (though it's done in a poor way) + doesn't start with - (again done in poor way) + 1 to 63 characters consisting of a-zA-Z and digits and hyphens only
I would put it like this:
actually never mind, never realized it was JS
JS-re suks
user652649
how would you write it with pcre?
^(?<!\/).*?\K(\[\d+\])(?=.*?;) will work in C# and will not return anything commented out with a "/". — jbarker2160 23 hours ago
/^[^-](?![0-9]+$)[a-zA-Z0-9-]{0,62}+(?<!-)$/
@WesleyCrushed It's the end of string anchor.
user652649
doesn't match "a1"
12:47
Oh.
/^(?!-|[0-9]+$)[a-zA-Z0-9-]{0,62}+[^-]$/
user652649
tough eh? :D
user652649
still not working anyway
the python one works in PCRE
the JS one also does
I usually explain it like this: if what's inside a negative lookahead matches, then fail the match
user652649
the python one didnt work for me
so if [0-9]+$ matches the string, then the match fails
[0-9]+ will match numbers and $ matches the end of the line. The two together basically matches if the entire string is numbers
well, together with ^ at the start, strictly speaking
user652649
12:55
i see (ish)
lol, I guess you need to get familiar with regex in general
user652649
the biggest problem i have with regex is that i don't have to use them often. so even if i try to learn something about them, i will eventually forget it, due to lack of practice
my practice stems from SO xD
user652649
i should just hire a @CSᵠ instead
I used to answer about every regex question I stumble on and can answer provided there is enough clarity and effort from OP. Now I most of the time just try to solve it in my mind and move on :s
13:01
...
well yea, there are people who already answered in the meantime and... I tend to read a question, got something else to do and when I come back it's too late
I used to sift through every question to find the good ones where it actually is worthwhile of getting an answer from me. Now I don't, I simply laugh at OP for not reading a book of Regex, and move on to the next.
Actually, one time the OP was so happy of my answer they found my website and donated money.
wow cool
user652649
@Unihedron did you laugh at me? xD
@WesleyCrushed I don't do it in comments. That's rude and barely constructive.
6
A: Regex matches only full condition, but it should settle with less for a search engine

UnihedronSee the regex: /^(?=.*status[:=](\S+)|)(?=.*type[:=](\S+)|)(?:.*?title[:=])?(?|"([^"]+)"|((?:(?!\s?(?:type|status)).)+))[^"]*$/ You can extract the information with capturing groups. Here is a regex demo! Expression explanation: ^ Asserts position at start of string. (?= Positive lookahead...

13:04
the only time I was close to getting monetary reward was from excel help. but I don't have paypal or something of the like, so... nada
I was really happy not for the money, but that someone actually made use out of my help and found it helpful.
My work environment is almost like this:
I wonder if there's any job not like that x)
user652649
13:27
@Unihedron are you actually 16?
yes
in JavaScript, 2 hours ago, by Unihedron
I'm 16 5/12
user652649
:D you rock kid! respect :P
user652649
/me has wasted his life
I'm just this other guy, you know?
user652649
to be 16 you have a great knowledge
13:31
@WesleyCrushed you keep changing your avatar/name...
Sometimes I just use /wes/i to remember it is you...
user652649
there is only one wes that is also a cock @HamZa
user652649
and that is me.
we have a minor...
@WesleyCrushed Great knowledge? You're kidding. Kids can't use computers, teachers can't use computers, and the demand for programmers is low in my place.
@Unihedron haha great article
13:33
Yes, I like that blog.
That said, I should really start my own website, where I write articles, tutorials and share links!
And have a cv-pls section!
@Unihedron nope.avi
not really interesting...
user652649
@Unihedron you from?
Well not from a company POV...
13:35
@WesleyCrushed hksar
@HamZa Well then, rebuild reddit.
step 1: fork reddit on github
step 2: deploy
step 3: ?
step 4: profit!
Oh this 10K is so nice btw :P
Congrats, now you have a site great from a company pov
user652649
hong kong? seriously demand for programmers is low there? thought it was one of the business capitals of the world :P
@WesleyCrushed I meant programmers whom could write code, not general infrastructure stuff.
Technicians are everywhere.
user652649
well there's china close, and i'm pretty sure they need programmers :P or you could move anywhere in the world :D
13:40
China needs programmers? You mean crackers? :P
I would love to move to somewhere else like sweden where there are demand for programmers, but I'm not really that good at programming to begin with.
user652649
talking of talented kids, i heard that the hk recent days protest was headed by a 16 year old :D
You're overestimating me. :P
@WesleyCrushed Yeah.
user652649
that's awesome :D
16:54
@Unihedron tried to make some sense of it in it's original shape regex101.com/r/wW9tL2/6
seems to be an interesting regex
would have some practical use
my idea wasn't that bad, except the implementation was tricky.
Cuz I cross-referenced the two groups, which messes with the backref.
It works like this:
eg. see which hand was used most on some text
For where caps comes first, we match as many caps character as possible, while capturing, starting from the first lowercase, as many lowercase as possible, missing out if needed
For when lowercase comes first, we do the opposite, except we don't allow missing out on uppercase, instead recursively check the inner region
wip
anyway i'm too burned out to make sense of anythign right now
16:59
helped a junior with some code neither of us understood... in jsp
i hate jsp
It's moderation hour for me, so I'm not that frequently chatting. I'm going to sleep soon though. Test tomorrow.
Java Server Pages!
never touched it before
argh
java should not do pages
i can't believe that's a thing
14 hours ago, by Unihedron
fools rush to where angels fear to tread
can't see why anyone would do web in jsp
anyone has android device ?
i just need to check other countries name from timezone other than pakistan
17:06
What is the purpose?
You wanna solve that with regex?
Of course "You can use regex for anything" lol
@Unihedron btw, how does my regex formatting look like
^_^
@CSᵠ It's great. 5 stars.
do we have // should we have, a code format rule when /x ?
^ ^ ^ cc @HamZa @hwnd @Jerry ^ ^ ^
@CSᵠ no
i mean, what the preety-est way we can format, most readable
hmmm
sounds like a RFC
need to research existing data first
Sounds like you'll need a research team... and five years
YES
who wants to be on funding this research team
we need funds
$$$
sometimes me is greedy, does not have question marks at end of text
I always format, if I need to like my regex tool formats
17:17
@hwnd cool!
You can use comments like that as well or use the comment group (?# ... )
18:07
@CSᵠ I do mine a bit like I write SQL. What's inside groups get an indentation except when |ing and comments if any are at least 2 whitespaces after the character the furthest to the right in the regex that does something
hmm, maybe go multiline on the comment if needed
i seem to tend to break the the last bit
something a bit like that:
foo
(?:
  bar # bar
|
  baz # baz
      # very baz
)
that is, whenever I use the /x mode. I do 2 space indent also, 4 is too much for me ^^;
 
2 hours later…
20:02
@Unihedron @CSᵠ guys here?
They are not in the room, what's up?
hi @hwnd
/([^\w.]|\.{2,}|\_{2,})/gi
I need a review on this regex
What are you trying to match
@hwnd It should return true for the following cases:
1. any character in the test is not a alphabet or number or _ or .
2. . or _ are used more than once simultaneously
yeah this is all
@hwnd is it good enough?
Example data?
20:10
I need that myself, but to list some:
awal.garg
newUser
awalGarg
awalGarg1997
awal1997
1997awal
garg1997awal
hwnd_awal.garg
awal_garg_1997
^these should fail
So what would pass?
awal..garg
__..
123_[]
'";'awal
or any such character
You said it should return true if " any character in the test is not a alphabet or number" the strings contain both as well.
What language are you using?
basically, this is for username. So I want to make sure that this pattern does not appear in the username.
@hwnd javascript
So "hwnd_awal.garg" would be valid or invalid?
20:19
@hwnd it would be valid as a username. but the regex would return false when tested against.
It sounds like it would be easier to look for valid usernames instead...
@hwnd how can I create an "inverted" version of this regex?
Something like this? regex101.com/r/lM8fT4/2
> Negative Lookahead - Assert that it is impossible to match the regex below
why? is this some technique?
I would recommend reading about lookaround assertions - rexegg.com/regex-disambiguation.html#lookarounds
20:29
hmm nice
It would take me a while to understand the regex you just made
thank you so much for putting in the effort @hwnd :)
I would understand yours
and ask if I have any confusion
also @hwnd how do we decide if we should match what is "not allowed" or match a specific allowed pattern?
If you're looking for valid usernames, I would define what is allowed.
hmm okay. The reason I went to match the invalid ones and reject, is because I just had those two rules about what is "not allowed" so I thought maybe I should just go with it.
But I would take care next time.
(?!) - Negative Lookahead foo(?!bar) matches foo when not followed by bar

« first day (600 days earlier)      last day (3192 days later) »