1

My current problem is that I have a string like this:

A1=ExampleText,B2=ExampleText,B2=ExampleText

I want to replace the 'T1=' and 'B2=' with a blank space so I send up with a string like this:

ExampleText,ExampleText,ExampleText

I have tried to use this piece of code

"A1=ExampleText,B2=ExampleText,B2=ExampleText" -replace '=([$,]*)'

This only removes the = sign, also want to remove the A1,B2...

A1ExampleText,B2ExampleText,B2ExampleText

can anyone please provide a regular expression to do that and explain how?

1 Answer 1

1

I think

\w+=

will do it for you.

It simply matches a number if word characters (a-z, A-Z, 0-9 & _), at least one, followed by an equal sign. Replacing that with '' should do it.

Check it out here at regex101.

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

Comments

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.