pipelian
pipelian

Reputation: 37

regex to remove all text with a conditionated pattern

Is there an easy way to remove specific parts of a string based on a pattern? For example, change 'hello\todelete5001\world\todelete4002\' to 'hello\world\'

Where 'todelete####' is the pattern (Using vb.net)

Upvotes: 1

Views: 25

Answers (1)

Jerry
Jerry

Reputation: 4408

Replace "todelete\d+\\" with an empty string.

Upvotes: 1

Related Questions