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
Search - "replaceall"
-
What fresh hell is this
.replaceAll("(//"?)([^//d]+)(//.?)([^//d]+)(//.?)([//d]{3})(//.?)([^/d]+)(//"?)","$1$2$3$4$5$6$7$8$9")
...who is fucking with me7 -
There should be a post type “facts” || “dev hints” || something like that where we can post cool stuff we figured out..
Like how to replaceAll in JS?
“Hello ranters”.split(“e”).join(“foo”);
JS devs probably know this but I didn’t, so yeah..3 -
String.replace and String.replaceAll in Java. Doubly anti-intuitive naming... First it makes you think replace will replace a single instance in the string but aCtUaLlY replace is replaceAllByExactMatch and replaceAll is replaceAllByRegexMatch.
Just as bad are C's fwrite and fseek which have the target FILE* in opposite ends of the parameter list2 -
Used the java replace method to remove specific characters with a regex. Wondered, why the characters weren't replaced until I realized I forgot that replace doesn't use regex but matches literally. Checked my previous code snippets, whether I made that mistake previously ... nope, I used replaceAll. 🤦2