Я пытаюсь использовать regex.match для извлечения различных шаблонов из данной строки. I have 3 patterns which i have to match and extract respectively.
1st Pattern : Starts with a string of alphabets, then followed by numbers only
2nd Pattern : Starts with a string of alphabets, then followed by numbers, and then a string of alphabets only
3rd Pattern : Start with a Число, затем за ним следует строка только алфавитов < /p>
Я пытался использовать: < /p>
regex.match(inputData, @"^(\ w+) (\ d+) $") // 1 -й паттерн < /p>
regex.match.match.match.match.match.match.match. @"^(\ w+) (\ d+) (\ w+) $") // 2 -й паттерн < /p>
regex.match(inputdata, @"^(\ d+) (\ w+) $") // 3 -й паттер я ложные положительные результаты) Если поставляемая строка недействительна. Я был бы очень признателен за некоторую помощь при исправлении соответствия шаблона. < /P>
Спасибо < /p>
Подробнее здесь: https://stackoverflow.com/questions/278 ... mbinations