+ Reply to Thread
Results 1 to 9 of 9

help with a function using Regex

  1. #1
    Registered User
    Join Date
    09-08-2008
    Location
    Elk Grove, California
    Posts
    21

    help with a function using Regex

    I have the following function which is very close to my needs with one exception. It is currently including the
    Colon, Ascii Char 058. I have made several attempts in trying to exclude that char with no positive results. If someone could point me in the right direction. It would be appreciated. I am interested in trying to understand out you going about structuring the pattern for what you want to include or exclude. Thank you in advance for your consideration.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: help with a function using Regex

    "\d+"
    simply means digests(Numbers) only
    You can use [0-9]+

  3. #3
    Registered User
    Join Date
    09-08-2008
    Location
    Elk Grove, California
    Posts
    21

    Re: help with a function using Regex

    I made the change, and I see that this "\d+" is the same as what you provided, [0-9]+, I may have not expressed by problem correctly. example of the string I am working with his three numeric digits, Colon :, space, Alpha text.
    How do I exclude the colon along with the numeric digits?

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: help with a function using Regex

    I do not know why the code does not exclude any character but numbers, but it is difficult to see with out the sample.
    You may try this, but I doubt it will work.
    [0-9:]+

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: help with a function using Regex

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Registered User
    Join Date
    09-08-2008
    Location
    Elk Grove, California
    Posts
    21

    Re: help with a function using Regex

    Thank you, I appreciate it. It did remove the colon, there is a leading space [032], can you tell me how I can remove it as well. again thank you in advance for your help.

  7. #7
    Registered User
    Join Date
    09-08-2008
    Location
    Elk Grove, California
    Posts
    21

    Re: help with a function using Regex

    thank you Mike, It worked as well, still have a leading space [032], I would to get read of, however could work around it. thank you and go aggies.

  8. #8
    Registered User
    Join Date
    09-08-2008
    Location
    Elk Grove, California
    Posts
    21

    Re: help with a function using Regex

    thank you both, I did solve it by using trim(function(cell). that got rid of the leading space

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: help with a function using Regex

    Why not just
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Complicated Regex
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2016, 12:23 PM
  2. RegEx not getting expression
    By amartinez988 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-01-2015, 11:14 AM
  3. Passing a RegEx to a function
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-31-2014, 06:12 AM
  4. [SOLVED] RegEx replace in range with lagre data set as sub/function?
    By knutfh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2013, 03:33 AM
  5. [SOLVED] How to REGex with VBA words
    By Odeen in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 12-03-2012, 09:12 AM
  6. Excel regex
    By f3tus in forum Excel General
    Replies: 1
    Last Post: 06-05-2010, 06:50 AM
  7. Return text with regex find function
    By jrussell in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-07-2010, 08:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1