Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Regular Expressions
  4. Regex: more than one identical character next to each other?

Regex: more than one identical character next to each other?

Scheduled Pinned Locked Moved Regular Expressions
regexhelptutorialquestion
2 Posts 2 Posters 15 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_16151681
    wrote on last edited by
    #1

    Hello all, I'm a newbie to regex and need some help. What I want to do is to check if a filename contains two or more _ beneath each other. For example: painting__test.pdf or painting___test2.pdf those should be replaced by only one _ hope you can assist in solving. kind regards Franz-Georg

    Richard DeemingR 1 Reply Last reply
    0
    • M Member_16151681

      Hello all, I'm a newbie to regex and need some help. What I want to do is to check if a filename contains two or more _ beneath each other. For example: painting__test.pdf or painting___test2.pdf those should be replaced by only one _ hope you can assist in solving. kind regards Franz-Georg

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Find _{2,} and replace with _. regex101: build, test, and debug regex[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups