Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列内の数値を取得するための正規表現が必要です。次に例を示します。
(white space) Schema.PCK.Name14500 (line feed)
また
(white space) Schema.PCK.14500Name (line feed)
(white space) Schema.PCK.Dog14500Cat (line feed)
ありがとう。
これを試して
var input = "Schema.PCK.*14500*Name"; Regex pattern = new Regex(@"Schema\.PCK\.([a-zA-Z]*)(?<num>\d+)"); var match = pattern.Match(input); string num = match.Groups["num"].Value;
複数(\d+)の番号を持っていない限り、行う必要があります。
(\d+)