RegEx - need to replace delimetered string with some its parts
-
Hi,
I have a string:
A - B - C - D or A - B - C - D - E (the number of delimeters is changing - delimeters contains sapaces before and after “-”)I need to replace them with:
B - C or sometimes C - D or D - E (if the string is shorter then E should be empty - this is optional feature) depending on my needs.I saw there is some quite easy formula for that, but I can’t find it.
-
I made something like that:
find: (.+) - (.+) - (.+)
replace: $2 - $3find have to be modified for the number of delimiters.
Maybe there is some more universal way to do that? -
same result:
find:.+(. - .)$
replace:$1 -
@Stanisław-Mędrzecki said in RegEx - need to replace delimetered string with some its parts:
How do you know when to replace with
B - C or sometimes C - D or D - E?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login