I need to find two types of instances when there is a “[” character using regular expressions:
- When the “[” character is followed by a number.
- When the “[” character is followed by letters.
In Java I have tried:
Pattern firstinstance = Pattern.compile("\\[abcdefgABCDEFG");
Pattern secondinstance = Pattern.compile("\\[[0-9]");
These however, don’t really seem to work. Do you guys have any possible suggestions?
Any decimal digit in any script:
Any digit in 0-9 only:
Any letter in any script:
Only letters in A-Z or a-z: