+ Reply to Thread
Results 1 to 5 of 5

RegEx - Pattern Matching

  1. #1
    Registered User
    Join Date
    10-16-2014
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    26

    Thumbs up RegEx - Pattern Matching

    Hello,

    I have a macro that checks a cell against a RegEx. I am trying to find out what the RegEx is for the following.

    These can be any number or letters

    N – Number
    L – Letter
    / “/”

    NNNNNNL/NN

    Example of a correct string 123456A/12

    I have tried the following but it’s not working.

    [0-9][0-9][0-9][0-9][0-9][0-9][A-Z]/[0-9][0-9]

    Thanks in advance.

    Paul

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

    Re: RegEx - Pattern Matching

    It should be working.

    Could be rewrite like

    "\d{6}[A-Z]/\d{2}"
    Last edited by jindon; 01-10-2017 at 08:43 AM.

  3. #3
    Registered User
    Join Date
    10-16-2014
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    26

    Re: RegEx - Pattern Matching

    Perfect that has worked. Is there any way to change it so the letter can be upper or lower case?

    Thanks again for all your help.

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

    Re: RegEx - Pattern Matching

    RegExp has IgnoreCase protocol, False for initial setting so something like
    Please Login or Register  to view this content.
    Will match to case insensitive.

  5. #5
    Registered User
    Join Date
    10-16-2014
    Location
    Manchester
    MS-Off Ver
    2010
    Posts
    26

    Re: RegEx - Pattern Matching

    It works! Thank you very much.

    Paul

+ 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. Read .PDF attachment, search for RegEx.Pattern
    By Anxiety in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2016, 12:13 PM
  2. Need to Define RegEx pattern
    By hmr2662 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2015, 09:24 AM
  3. RegEx pattern
    By capson in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 02-15-2015, 06:57 PM
  4. [SOLVED] RegEx pattern, code exacuting but doing nothing
    By capson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2015, 03:48 PM
  5. Regex: Matching pattern to split a cell data
    By DavidRoger in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-01-2014, 07:31 AM
  6. Regex - establishing a pattern
    By twckfa16 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-30-2014, 11:06 AM
  7. Need a new regex .pattern for comparison code
    By Swiss Cheese in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2012, 09:16 PM

Tags for this Thread

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