I want to extract all digits within different scopes.
1st scope: $ $
2nd scope: # #
Extract all digits within the 1st scope
$1-2$
Wished result
1, 2
$1#4#-2$
Wished result
1, 2
Extract all digits within the 2nd scope
$1-2#4-9-6#3-4$
Wished result
4, 9, 6
Note The - is there to separate each digit and the number of digits in each scope may differ from time to time
My current Regex: (^[$])([\d]+)(|-\d+)*(|#[\d]+((|-\d+)*)#)([$]+)($)
Any help is appreciated!