Someone might have something better, but I think you could use the up to a colon match, and replace with <strong>\1</strong>. This might double strong your numbers. Then search for <strong><strong>(.*?)</strong></strong> and replace with <strong>\1</strong> to get rid of the duplicate holding. It’s a two step processes.
-Jim Straus On May 14, 2023, at 5:05 PM, 'Andy Nickless' via BBEdit Talk <[email protected]> wrote:
No Kaveh - Unfortunately Fletcher's reply doesn't help. I'll try to clarify. In this case, I want to make bold parts of some lines of text which begin with <p> up to where the bold part will end at a colon (:) Any text after the colon won't be bold.
<p>All this text will be bold, as until the first colon: The text after the colon will be normal.</p>
<p><strong>123</strong>Any lines which begin as this one does, will not be changed.</p> (The number being any combination of 1-3 digits).
I hope that's more clear. Apologies for the lack of clarity. Andy On Sunday, 14 May 2023 at 20:11:38 UTC+1 Kaveh Bazargan wrote:
Sorry, still not clear for me. Does Fletcher's answer work?
Are you saying there are specific numbers you do not want to match, say <strong>135</strong> but ones that you do want to match, say <strong>137</strong>
?
Otherwise can you explain further?
On Sun, 14 May 2023 at 18:09, 'Andy Nickless' via BBEdit Talk < [email protected]> wrote: Yes, of course, Kaveh - thanks for your speedy reply - again!I got this the other day (you helped with it) to find a line of text (or text and numbers) which end with a colon and a space - <p>(.+?)\: It's brilliant, but there are occasions when I want to avoid a pattern such as <strong>123</strong>. The number varies, (from 1 to 999) and there may be other numbers, but I want to include those. In other words, avoid lines with numbers within the <strong></strong> tags.
At other times, I want to avoid a certain word (or html). I hope that makes sense! Andy
On Sunday, 14 May 2023 at 17:57:20 UTC+1 Kaveh Bazargan wrote:
can you give examples of strings you want to match and strings you don't want to match?
On Sun, 14 May 2023 at 17:29, 'Andy Nickless' via BBEdit Talk < [email protected]> wrote: Something that I've been unable to find out is how to skip searching something which already contains a simple pattern: For instance, to find a number consisting 1-3 digits I use (\d{1,3}) - but how can I AVOID a number of up to 3 digits? Thanks in advance - Andy
--
Kaveh Bazargan PhD DirectorAccelerating the Communication of Research
--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
--
Kaveh Bazargan PhD DirectorAccelerating the Communication of Research
--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email " [email protected]" rather than posting here. Follow @bbedit on Twitter: < https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/e8c65a54-7efb-44e5-9bbd-06d306f7aa8en%40googlegroups.com.
--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/5221EB9B-64AA-4E6C-8DC6-40CA4B014703%40gmail.com.
|