You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to using magic-regexp and regexp in general. Am I misusing the API or is there a bug. Simple rules I try to define don't work as expected. Like this one for timeString.
const timeRegexp = createRegExp(
charIn("01")
.optionally()
.before(charIn("0-9"))
.or(exactly("2").and(charIn("0-3")))
.and(exactly(":"))
.and(charIn("0-5").and(charIn("0-9")))
.at.lineStart()
)
/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/): is what I am trying to implement.
The stings I pass keep failing the test.
This is another one. oneOrMore(charIn("A-Za-z0-9").or(" ")). Won't allow strings unless there is a space. But I actually specified or.
Help and clarification would be apprecieted. Going through the docs did not help me figure out the problem.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am new to using magic-regexp and regexp in general. Am I misusing the API or is there a bug. Simple rules I try to define don't work as expected. Like this one for timeString.
The stings I pass keep failing the test.
This is another one. oneOrMore(charIn("A-Za-z0-9").or(" ")). Won't allow strings unless there is a space. But I actually specified or.
Help and clarification would be apprecieted. Going through the docs did not help me figure out the problem.
Beta Was this translation helpful? Give feedback.
All reactions