Update reg.py
Browse files
reg.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
import re
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
pattern
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import re
|
| 2 |
|
| 3 |
+
def check_sentence(sentence):
|
| 4 |
+
# Define the pattern for the sentence starting with 'a-b-c' and ending with 'x-y-z'
|
| 5 |
+
pattern = r'^a-b-c.*x-y-z$'
|
| 6 |
+
# Use regular expression to match the pattern
|
| 7 |
+
if re.match(pattern, sentence):
|
| 8 |
+
return True
|
| 9 |
+
else:
|
| 10 |
+
return False
|