Re: Regular Expressions was Re: Can you please help???
- View SourceSheri,
Now is a good time for us to repeat the helpful links for regex help
that you have given before (one is at end of this email). One of them
is what finally got me over (or at least on) the hump of understanding.
It was a helpful tips type of presentation. I converted it from a
powerpoint to plain text so that I could use it in notetab easier (and
search it better) and I also now keep a "handyregexbits.txt" file in my
favorites. It has things like (?s) in it which is the multi-line
I find I use it less and less as I actually now start to understand what
I am doing and why I am doing it.
Lastly I would encourage anyone starting with regex to get regex buddy.
Whenever a pattern I write doesn't match as expected, I use that
program. I start slowly at the left and move to the right and it shows
what is matched when you select part of the search term it highlights
the match in the lower window. Solves many issues.
Someday I'll tackle look backs and assertions and stuff like that ...
but for now, I really think I can do some amazing stuff with a good
regex search term. I still use \r\n just because \R didn't work when I
started ... I'll try to improve and actually I have used \R a few times
Have a great night everyone.
Andrei’s Regex Clinic
I note that there are some more recent versions -- I'll have to download
and see if they have advanced.
I believe regex discussion is essentially welcome either her or in clips
list. Is that fair? I have copied both groups.
> Hi Rudi,
> Using regex in NoteTab's Find and Replace dialog or clipcode, you can match CRLF with \R or with \r\n. Another way is to include linebreak characters in what matches dot, by including (?s) at the beginning of your find pattern.
> You can include a CRLF in replacement text with \r\n
> However, I believe the following would best suit your purposes:
> ^!Replace "^(<cardset|releasedate|card_count).+" >> "" RAWS
> Since the CRLF is not matched, it is still in the file after the replacement. If you want an extra line inserted for each match, it would be:
> ^!Replace "^(<cardset|releasedate|card_count).+" >> "\r\n" RAWS
> There is a detailed, techy regex.chm file in the NoteTab application folder that gives all the details for the PCRE regex engine used in NoteTab. You can access it from the Help menu.