How to remove the unwanted characters and special symbols using regular expression?

40 ビュー (過去 30 日間)
How to remove the unwanted string given below using regular expression
Input: 21;#700J Crawler- Pre-Calibration_Template.xlsm;19
Desired output: 700J Crawler- Pre-Calibration_Template
  2 件のコメント
raghavendra kandukuri
raghavendra kandukuri 2018 年 11 月 29 日
Hi Guillaume,
everything before '#' and every thing after'.' need to be cleared or truncated

サインインしてコメントする。

採用された回答

Guillaume
Guillaume 2018 年 11 月 29 日
編集済み: Guillaume 2018 年 11 月 29 日
"everything before '#' and every thing after'.' need to be cleared or truncated"
then it's very easy:
regexp(yourinput, '(?<=#)[^.]+', 'match')
which basically keeps everything after the first # until it encounters a .

その他の回答 (0 件)

カテゴリ

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by