'Extracting a specific pattern of characters using regular expression

I have the following pattern for a string: "IGHV1-20*00(1374.6),IGHV1-37*00(1333.7),IGHV1-9*00(752.5)". My expected output should look like: "IGHV1-20,IGHV1-37, IGHV1-9".

I'd appreciate any advice on what regex pattern could be defined to extract this output using gsub/str_extract.



Solution 1:[1]

I think you want to match anything that:

1, starts with IGHV 2, then a digit followed by '-' 3, one or more digits till the nearest '*'

Try writing a regex with this.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 anotherGatsby