I want to find in a text all ocurrences of blocks between curly brackets, that contains any non-numeric character.
For example, in the text:
something {34dj 4s} and something else {335} and more {dgw} and {6} or whatever
it should match 2 items: {34dj 4s}
and {dgw}
I have tried with this (im using it in .net c#) but it will match only ocurrences that ONLY contains non-numeric characters...:
@"{[^0-9]*}"
You may use this regex to match {...}
with at least one non-digit in between:
\{[0-9]*[^0-9}][^}]*}
RegEx Details:
\{
: Match {
[0-9]*
: Match 0 or more digits[^0-9}]
: Match a non-digit[^}]*
: Match 0 or more of any character that is not }
}
: Match }