S
S
SevSergei2018-06-21 12:08:19
Regular Expressions
SevSergei, 2018-06-21 12:08:19

How to find parse this string?

There is a text, it can contain templates of the form:
{Task #1 - Parameter ZH-10: 03:00}
The essence of parsing:
1. Find the template {Constant #[NUMBER] ( - Constant [CODE]: [TIME])? } in the text
( - Constant [CODE]: [TIME]) - may be optional
2. Parse the found pattern into number code and time

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick Sdk, 2018-06-21
@SevSergei

/Задача #(\d+)(?: - Параметр ([a-z\-0-9]+): (\d+:\d+))?/

https://regex101.com/r/Ix0NGM/2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question