1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Help with Regex

Discussion in 'Web Design & Development' started by colinsp, Dec 26, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. colinsp

    colinsp Thread Starter

    Joined:
    Sep 5, 2007
    Messages:
    2,302
    First Name:
    Colin
    I am trying to create a Regular expression to find a whole sentence that starts with the word

    Here's

    and ends with a

    .

    What I have so far is

    Code:
    (?sx-m)[^\r\n].*?(?:(?:\.|\?|!)\s)
    
    This finds a whole sentence but I have modified it every way that I can think of to get it to find the sentences that i want without success.

    Has anyone got an ideas?

    Whilst you are at it I also need to find a series of numbers in the format of

    2,3##,###

    Anyone know what the regex for this would be?

    TIA
     
  2. colinsp

    colinsp Thread Starter

    Joined:
    Sep 5, 2007
    Messages:
    2,302
    First Name:
    Colin
    Sorted this another way without Regex so marked as solved.
     
  3. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,393
    First Name:
    Jim
    What was the "another way" Colin? I'm curious!
     
  4. colinsp

    colinsp Thread Starter

    Joined:
    Sep 5, 2007
    Messages:
    2,302
    First Name:
    Colin
    I ended up using some of the Replace features in Notepad++ which marks lines as bookmarks (rather than using the regex search/replace options) and then you can delete the bookmarks. It worked perfectly for the text I was editing as this wasn't directly for a web page but was for cleaning some text before displaying it on a web page.
     
  5. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,393
    First Name:
    Jim
    Thanks Colin - I also use Notepad++, but hadn't seen that feature - ta(y)
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1082424

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice