#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2017
    Posts
    3
    Rep Power
    0

    Need regex to extract specific strings


    I need to extract particular strings from a huge text file. The length of the string is 58. For this I need to write a regex expression.

    The string has 8 spaces in the starting, followed by alphabets(caps as well as lower case ), numbers and spaces....and ends with a number.

    With (.)[0123456789]$ expression I can figure out that the last character is a number. But how do I specify the condition that starting has 8 spaces, followed by anything and then ends with a number.

    Can anyone give me some solution?
  2. #2
  3. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,458
    Rep Power
    9645
    Simply based on the description of the string,
    Code:
     {8}[a-zA-Z0-9 ]*[0-9]
    Can you give some varied examples of what should and should not match?

IMN logo majestic logo threadwatch logo seochat tools logo