47
stisch
7y

What fresh hell is this

.replaceAll("(//"?)([^//d]+)(//.?)([^//d]+)(//.?)([//d]{3})(//.?)([^/d]+)(//"?)","$1$2$3$4$5$6$7$8$9")

...who is fucking with me

Comments
  • 11
    You sir, are going to have a bad day.
  • 9
    Ask regex101.com maybe?
  • 2
  • 4
    Ok found it
    You can use “the regex coach” it will break down the regex and explain what it’s doing

    Mind you it’s slow but it’s useful

    http://www.weitz.de/regex-coach/
  • 3
    Optimize it by replacing it with a comment. It'll have the same effect. 😞

    Just ... ugh.
  • 1
    The URL for this rant looks like you broke devRant for a sec.
  • 3
    @Brosyl oh yes! You're right, the slashes are backwards. I entered it from memory on the Android keyboard, a bit disorienting.

    The end result is that it replaces all matches with itself, which means taking the entire line out would have no effect. Some git history investigation revealed it had 'evolved' to that over multiple commits by multiple authors.. some of whom I assume don't understand regular expressions.
Add Comment