I am trying to write a regular expression and matches 3 conditions and will return true if all three are satisfied .
Condition 1) string starts with a "{"
Condition 2) string DOES NOT contain a space somewhere between brackets
Condition 3 string ends with a "}"
So far I have come up with ^{|[ ]|}$one that checks for a space. But I need to do this if there are no spaces between the brackets . It will also return true if the string begins with {but does not end with a character }and vice versa. I was messing around with regex101.com, but I canβt determine if there is any part of the space.
Can someone explain how to match if there is no in the line ?
source
share