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. Match all lines except lines beginning with numbers or a few alphabets

Match all lines except lines beginning with numbers or a few alphabets

Scheduled Pinned Locked Moved Regular Expressions
regexhelp
2 Posts 2 Posters 28 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.
  • D Offline
    D Offline
    Diamond Dallas
    wrote on last edited by
    #1

    Dear friends, I am new to this forum. I need your expert advise on deriving a regular expression to achieve the following. I am using Editplus' search and replace. I could use Notepad++ as well, if required. I have some files containing several thousand lines of content. I want to match lines in the content except the ones which start with a number and period (1. or 2. .......... 5000.) or the first 4 alphabets and a period (a. or b. or c. or d.). Any help is greatly appreciated. Thanks in advance. Diamond Dallas

    M 1 Reply Last reply
    0
    • D Diamond Dallas

      Dear friends, I am new to this forum. I need your expert advise on deriving a regular expression to achieve the following. I am using Editplus' search and replace. I could use Notepad++ as well, if required. I have some files containing several thousand lines of content. I want to match lines in the content except the ones which start with a number and period (1. or 2. .......... 5000.) or the first 4 alphabets and a period (a. or b. or c. or d.). Any help is greatly appreciated. Thanks in advance. Diamond Dallas

      M Offline
      M Offline
      Member 13115581
      wrote on last edited by
      #2

      Old post but... I think this should work (for anyone who has a similar need). You can change the 1 to 0 if you want to avoid lines that begin with "0." as well. Also note that "aa." (or similar) will be matched/returned, since the request was to specifically avoid lines that start with a SINGLE letter (a, b, c, d) followed by a period. But this is easy to adjust as necessary if multiple letters followed by a period should also be skipped/avoided. ^(?![1-9]+\.|[a-d]\.).+$

      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