Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit e688650

Browse files
committed
Added short comments to the regex
1 parent aacdd21 commit e688650

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/scala/org/codeoverflow/chatoverflow/requirement/parameter/ColorParameterImpl.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class ColorParameterImpl extends ColorParameter {
1919

2020
override def deserialize(value: String): Unit = {
2121

22-
val hex3 = "^#([a-fA-F0-9]{6})$".r
23-
val hex4 = "^#([a-fA-F0-9]{8})$".r
24-
val int3 = "^(\\d+),(\\d+),(\\d+)$".r
25-
val int4 = "^(\\d+),(\\d+),(\\d+),(\\d+)$".r
26-
val float3 = "^(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?)$".r
27-
val float4 = "^(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?)$".r
22+
val hex3 = "^#([a-fA-F0-9]{6})$".r // Test if the value contains # and then 6 hexadecimal numbers
23+
val hex4 = "^#([a-fA-F0-9]{8})$".r // Test if the value contains # and then 8 hexadecimal numbers
24+
val int3 = "^(\\d+),(\\d+),(\\d+)$".r //Test if the value contains 3 ints
25+
val int4 = "^(\\d+),(\\d+),(\\d+),(\\d+)$".r //Test if the value contains 4 ints
26+
val float3 = "^(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?)$".r //Test if the value contains 3 floats
27+
val float4 = "^(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?),(\\d+(?:\\.\\d+)?)$".r //Test if the value contains 4 floats
2828

2929
try {
3030
value match {

0 commit comments

Comments
 (0)