正则表达式查找 '<' character followed by another character in a string

问题描述 投票:0回答:1

我正在寻找一个正则表达式来查找 '<' character followed by another character in a string. For example:

1) "<a" = true 2) "<?" = true 3) "?sds" = false

谢谢!

基本上需要扣除字符串是否包含'<' character followed by any other character.

c# regex regex-group
1个回答
0
投票

使用正则表达式模式<. to match a '<' character followed by any other character in C#:

bool contains = Regex.IsMatch(input, "<.");

用字符串变量替换输入。对于“

© www.soinside.com 2019 - 2024. All rights reserved.