How to use regexp for the following?

조회 수: 1 (최근 30일)
Prajwal Venkatesh
Prajwal Venkatesh 2020년 1월 20일
답변: Guillaume 2020년 1월 20일
I want to use regexp for the following string 'ME5708' ,
S[lower( 'o the first two characters should be uppercase alphabets and the next four characters should be numbers')]
(don't shout--dpb)

채택된 답변

Guillaume
Guillaume 2020년 1월 20일
If you want to extract two uppercase letters followed by four digit:
regexp(yourinput, '[A-Z]{2}\d{4}', 'match')
I recommend that you try to learn regular expression. This particular expression is very simple.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by