'Regex matching of character class and special conditions on certain other conditions
I want to match a section of a string that contains certain characters repeated, along with certain other characters only given a certain criteria. For instance matching characters a-z contained in angle brackets and numbers only if the number is preceeded by a plus.
Matching <abcde> to abcde.
<abcde1> should not match anything.
Matching <abcde+1> to abcde+1
Matching <abcde+1asd+2+3+4as> to abcde+1asd+2+3+4as
<abcde+> should not match anything.
The regex I've tried is <([a-z]|(\+(?=[0-9])|[0-9](?<=[\+])))*>.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
