特殊字符的正则表达式

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

任何人都可以帮助获得下面输入字符串的正则表达式构建,我需要提取标记为的数据。例如:-

输入文字:-

☐I am good
☐This is sky
☒Nice to meet you
☐hello world

输出:-认识你很高兴

regex regex-lookarounds regex-group regex-negation
1个回答
1
投票

仅使用

^☒.+

请参见a demo on regex101.com


如果您碰巧将它放在一行中,则可以使用
☒[^☐\n]+

请参见another demo on regex101.com

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