Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Traser10525yI know that I said it's the wrong category but my mind wasn't able to stop thinking about this regex. So I tried something. However, you still need to define the special characters yourself.
https://regex101.com/r/BWM3ij/2 -
@irene I tried a lot of stuffs like for excluding space
^/s this is what I tried... But unfortunately did not get what I wanted -
Traser10525y@nitwhiz maybe the space needs to be replaced with \s in some cases.
Updated with v5
https://regex101.com/r/BWM3ij/5 -
@NitinSahu that's probably better. I love regex but this is done way more performant by split & filter (i guess, would like to see a jsperf over 10000 space seperated words here).^^
Regex does it token by token in x iterations (x being whatthefuckdoiknow) while split & filter does it token by token once and then just checks equality n times (n being the count of words), i think a comparsion could get intersting. Don't forget that filter involves a function being called for every element, that being at least 2 jmp and a closure every time.
Related Rants
-
Cyanide20Windows: Copying 2,513 items from <here> to <here>. Me: OK. Windows: 84% complete. Me: OK. Windows: Shit. Me...
-
polambo17Kids of these days will never understand this strugle
-
k0pernikus11Manager: The thing you working on. We need this now! Like end of the week. Me: Desirability is not do-ability...
What will be the regex to include all words concatenated with special characters but exclude whitespaces
rant
stuck
doubts
urgent