1

I'm trying to replace a string like

<p><strong>@001@</strong></p>

or

<p><strong>@002@</strong></p>

or

<p><strong>@010@</strong></p>

or any other number from 1-to 10 in empty string.

i've tried this

Regex.Replace(HTML, @"[<p><a-z>@0-9@</a-z></p>]", "");

But it remove all the html tags from the string

0

1 Answer 1

1

Seems like you want something like this,

Regex.Replace(HTML, @"<p><(\w+\b[^<>]*)>@0(?:0[1-9]|10)@</\1></p>", "");

DEMO

Sign up to request clarification or add additional context in comments.

1 Comment

THANKS A ALOT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :) but how can i do if i want any number betweed 1-99 ? like @024@ to replace ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.