+ Reply to Thread
Results 1 to 1 of 1

Syntax to make long RegExp Pattern readable?

  1. #1
    Registered User
    Join Date
    02-27-2008
    Location
    Irving, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    96

    Red face Syntax to make long RegExp Pattern readable?

    EDIT: After clicking submit on this post, I had an inspiration that because I was breaking a string across multiple lines of code, I needed to close the quotes appropriately. Using the code below, I got my .Pattern to work:

    Please Login or Register  to view this content.

    I'm posting it here for those who might also have the same question, but not be fortunate enough to have the inspiration I did.

    Hi all,

    I feel like this is a simple problem, but I've been unable to fix it. I'm using a Regular Expression object with a pretty long .Pattern. I want my code to be readable, so I'd like to take the long .Pattern and break it onto 2 lines, like I would w/ any other long lines of code. Here's my regular expression:

    Please Login or Register  to view this content.

    My assumption would be to pick the spot to break it, do a space and an underscore, then new line and tab, like this:

    Please Login or Register  to view this content.

    However, that's an incorrect syntax at runtime. What's the trick here that I'm missing? How does one make a long .Pattern span multiple lines of code?

    Thanks,
    Adam
    Last edited by ahartman; 07-16-2010 at 02:30 PM. Reason: Inspiration after posting lead to fixing the problem
    -Adam Hartman
    Mechanical Engineer

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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