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. What Could Be RegExp For?

What Could Be RegExp For?

Scheduled Pinned Locked Moved Regular Expressions
testingbeta-testingregextutorialquestion
2 Posts 2 Posters 4 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.
  • I Offline
    I Offline
    IbnUlAdam
    wrote on last edited by
    #1

    What can be the RegEx for matching all spaces in quotes but not quotes.. Example: "This is testing text" My RegEx: (?<=\")\s+(?=\") The above RegExp is not matching all spaces..

    P 1 Reply Last reply
    0
    • I IbnUlAdam

      What can be the RegEx for matching all spaces in quotes but not quotes.. Example: "This is testing text" My RegEx: (?<=\")\s+(?=\") The above RegExp is not matching all spaces..

      P Offline
      P Offline
      Peter_in_2780
      wrote on last edited by
      #2

      The \s+ in that regex will only match a single string of one or more consecutive whitespace characters, not "all spaces" So your regex would match "This test" or "This      test" but not "This is testing" There are lots of online regex builders and analysers, which I suggest you seek out.

      Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

      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