JA1
JA1

Reputation: 568

Remove starting from end up to first close parenthesis

I asked this question RegEx to match last occurence of semicolon and it worked well. For some reason I can't pinpoint I'm getting duplicate ; ; at the end of my string.

To ensure the fix is universal I have one constant that will not change is the character preceding these double semi colons is a closed parenthesis )

How would I go about matching from the end of the string and stopping on the )

I was able to fix the problem using the following ;;[^;]*$

AB12(1,2,3,4);AB12(1,2,3,4,5,6);;

Upvotes: 1

Views: 34

Answers (1)

anubhava
anubhava

Reputation: 786101

You can search using this pattern:

^(.*\)).*$

And replace by:

$1

RegEx Demo

Upvotes: 1

Related Questions