General questions about using TextPad
Moderators: AmigoJack , bbadmin , helios , Bob Hansen , MudGuard
bevhoward
Posts: 27 Joined: Tue Oct 05, 2004 6:38 pm
Location: Austin, Texas, USA
Contact:
Post
by bevhoward » Tue Aug 30, 2016 5:13 pm
Can someone help with the syntax for finding complete div statements using wildcards?
An example is;
Code: Select all
<div class="ygrps-yiv-966925050yiv2931130974MsoNormal"><br><br></div>
...where the text after the
<div class="ygrps-
is unpredictable, so, what I need is a wildcard statement to match anything between;
<div class="ygrps-
and
</div>
I am sure that part of the problem is that there are instances of nested brackets within these cases.
I've been though the help file on regular expressions several times today and I do have a fair amount of experience with expressions, but everything I have tried today fails.
Thanks in advance,
Beverly Howard
bevhoward
Posts: 27 Joined: Tue Oct 05, 2004 6:38 pm
Location: Austin, Texas, USA
Contact:
Post
by bevhoward » Tue Aug 30, 2016 9:46 pm
Looks like
works
Beverly Howard
ben_josephs
Posts: 2461 Joined: Sun Mar 02, 2003 9:22 pm
Post
by ben_josephs » Tue Aug 30, 2016 11:04 pm
If a line contains more than one div element your regex will match from the beginning of the first one to the end of the last one.
To match the individual div elements separately, try
<div class="ygrps-.*?></div>
The * operator matches as much as possible; the *? operator matches as little as possible.
bevhoward
Posts: 27 Joined: Tue Oct 05, 2004 6:38 pm
Location: Austin, Texas, USA
Contact:
Post
by bevhoward » Tue Aug 30, 2016 11:46 pm
Thanks... the education is appreciated.
Beverly Howard