Re: [NTB] Stripping text up to a given character
- true ... exactly the kind of thing a sample would show I guess ... early
in the morning
I like your middle one -- repeat same time 3 very efficient ...
I don't quite get the last one however ... what does that ?: (at least I
think it's a questionmark colon) do?
> --- In email@example.com, "Don - HtmlFixIt.com" <don@...> wrote:
>> to take out everything up to and including the third _ on each
>> line we use this:
>> 1. click on search an replace
>> 2. choose regex
>> 3. be sure you are at the top of the document
>> 4. type this is the search box (minus the quotes) ".*_.*_.*_"
>> 5. hit replace all
>> If you do it often do it with a clip (include the quotes this time):
>> ^!Replace ".*_.*_.*_" >> "" RAWS
>> Clips are generally discussed on a different list, but since this
>> was an easy one I put it there, but no further discussion of it
>> should occur here.
> Hi, It doesn't matter if there are only 3 underscores on a line, but that pattern (whether used in the dialog or from a clip) would match everything up to and including the LAST underscore on each line. It needs some non-greedy indicators (question marks). Also, to match from the beginning of each line, it needs to start with a caret. Without that, the next three to be matched could occur on the same line. Any of the following would match through the third underscore per line.
> Fookes Software: http://www.fookes.com/
> NoteTab website: http://www.notetab.com/
> NoteTab Discussion Lists: http://www.notetab.com/groups.php
> Yahoo! Groups Links
- --- In firstname.lastname@example.org, "Don - HtmlFixIt.com" <don@...> wrote:
>Normally the parenthesized part of the pattern would be captured, in this case as $1. Question mark colon says don't bother to capture. Its more efficent to disable the capture when unused, and in this case (because the repetition) the capture would be useless anyway. Without the question mark colon, $1 would exist but it would contain only the last of the three matches of .*?_
> true ... exactly the kind of thing a sample would show I guess
> ... early in the morning I like your middle one -- repeat same
> time 3 very efficient ... I don't quite get the last one however
> ... what does that ?: (at least I think it's a questionmark
> colon) do?