I am hopeful there is a Regex guru who can help me with this particular problem. I have not had a great amount of experience using regex, though am mostly fine with the simpler elements.
What I am trying to do is strip a certain element from a string that contains a full filename with bracketed data. The data I need to check for is in the format(s) of,
(Disc 1 of 2)
and variations of. These are unique and only one instance is present per string (or none)
I need to locate these and extract the first value (numerical), a '1' in the cases posted. This value I want to use to create a uniform format of the myrad of formats shown above.
The second number is not needed as I only want to create a string of the format
Any help would be wonderful as I have been struggling with this for some time.
Thanks, but this will just find the first digit in the filename. I mentioned that I wanted to strip a certain element from a string that contains a full filename with bracketed data. I should really have given a better description rather than just the bracketed data I wished to match/search.
So, I need to grab the braketed area (sometimes in square brackets) and then take the first digit(s). This is where my knowledge comes completely unstuck. I am sure there is an elegent way to do this. Well... mostly sure.. lol
Though, also noting that not all bracketted areas are related to disc numbers. Some may contain revisions, regions, or other data. So, just trying to find a match pattern that works with the examples in the first post really (without grabbing non-matches).