Loading ...
Sorry, an error occurred while loading the content.

24112RE: RE: [Clip] REGEX Search Backward

Expand Messages
  • John Shotsky
    Nov 1, 2013
    • 0 Attachment

      There are no dumb questions - if one doesn't know, they don't know. The (?s) tells regex to ignore line ends. Regular replaces reach only to the end of the line, but if you want something in the middle of the file, you are clearly going to have to accept line ends, thus you start the line with (?s). Be careful with this, or you will be changing things far from what you intend to change.

       

      Regards,
      John
      RecipeTools Web Site: http://recipetools.gotdns.com/
      John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/

       

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of lls01pat@...
      Sent: Friday, November 01, 2013 10:31
      To: ntb-clips@yahoogroups.com
      Subject: RE: RE: [Clip] REGEX Search Backward

       

       

      Hi John

      I'm new(ish) to this group and have a question about your post - the (?s)\A is something that I have been looking for for a while (as a way to identify the beginning of the file). Could you explain to me what the (?s) does? I tried this as straight \A and it doesn't work so clearly the (?s) is necessary.

      Sorry if this seems a dumb question

      Best

      Paul 



      ---In ntb-clips@yahoogroups.com, <ntb-clips@yahoogroups.com> wrote:

      One way to do that is to start your search with (?s)\A, which is the beginning of the document. Then, the item you are looking for, then the last item that you are looking 'backwards' from. This is still a search down, only you have anchored it to start at the beginning of the doc and search down to your final term.

       

      Regards,
      John
      RecipeTools Web Site: http://recipetools.gotdns.com/
      John's Mags Yahoo Group:  http://groups.yahoo.com/group/johnsmags/

       

      From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of nullclip@...
      Sent: Friday, November 01, 2013 09:04
      To: ntb-clips@yahoogroups.com
      Subject: [Clip] REGEX Search Backward

       

       

      I am new to REGEX searchs.

       

      I attempted a REGEX search backwards in an outline topic for any URL, but got a 'could not find, start at the beginning' standard message.  The search works great forward.  The outline topic has many URLs in it.

       

      Is this an issue with REGEX?  Any ideas?

    • Show all 25 messages in this topic