« first day (2512 days earlier)      last day (906 days later) » 

2:54 PM
@MartinSleziak Technically, regex is not really javascript. Many different languages support similar regex syntax (because nobody wants to learn a different syntax).
 
I understood that \d stands for a digit, but I wasn't sure about [\d-]. So [\d-]+ just means one or more digits? And |[a-z] just means that a letter is possible, too?
 
For javascript in particular you can see here to understand the regex /^\s*[cd]?(?:[\d-]+|[a-z])\s*$/i.
 
So I guess, there would be also a possibility to allow "/" as the third alternative, to allow for "C/D".
 
@MartinSleziak [\d-] means ( either digit or dash ). + means ( one or more ). | means ( or ).
@MartinSleziak Yes I can easily add in the possibilities, but it's best to stick to the recognized formats unless we update the upstream version otherwise everyone who downloads from the official source would get a 'broken' interface.
 
I see. I thought that - has some specific meaning - and it is just a character.
So something like [\d-/] might possible work? Maybe / needs to be escaped, hence [\d-\/]?
 
3:00 PM
No that's the wrong place! That's for digits at the back.
 
@user21820 I understand that. Of course, that's for the users who use and maintain those userscripts.
 
The front is captured by [cd]? which means ( possibly "c" or "d" ).
 
I was just being curious.
 
Changing that to (c?d?)? would accept the previous syntax as well as "CD" and "CD1", but reject "DC1".
 
I have mentioned "/" mainly because at least one user around here is used to "C/D".
In any case, I have to do something IRL so I'll need to leave. See you later!
 
 
3 hours later…
6:28 PM
15 messages moved from CURED
@MartinSleziak: I moved our discussion here, but feel free to move it anywhere else you prefer. =)
@MartinSleziak Sorry I missed your message somehow. I replied there.
 
7:10 PM
I actually use regular expressions quite a lot - so I thought that I am relatively fluent.
It seems not to be the case. (Maybe it's just that situations where I use them are different.)
 

« first day (2512 days earlier)      last day (906 days later) »