I need to fix some text that lies between delimiters for the following cases:
Case 1: {12345}
(numbers between curlies) should become item_12345
(added 'item_', removed braces).
Case 2: [999]
(numbers between square brackets) should become total_999
So this string: {242424} from X [100] bulks, linked to {57575757} from Y for [500] units
should appear like this: item_242424 from X total_100 bulks, linked to item_57575757 from Y for total_500 units
How can this be done with regex?