正则表达式匹配英语和非英语字符 [英] Regular Expression to match English and Non English characters

查看:155
本文介绍了正则表达式匹配英语和非英语字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试匹配包含英语和非英语字符但不包含纯数字(包括小数)的句子。

I am trying to match a sentence that contains both English and Non English characters but does not contain pure numeric including decimals.

示例 - 应匹配::

Example - Should match::

Renforcé-Bettwäschegar BLUMIRA123

不匹配::

999.99

以下代码匹配ASCII字符中未包含的所有内容 -

The following code matches everything that's not contained in the ASCII characters -

[^\u0000-\u0080]+

这就是我现在所拥有的一切。任何帮助将不胜感激。

This is all I have at the moment. Any help will be much appreciated.

谢谢。

推荐答案

感谢您的投入。以下正则表达式似乎对我有用。

Thanks for the inputs. The below regex seem to work for me.

^([x00-\xFF]+[a-zA-Z][x00-\xFF]+)*

这篇关于正则表达式匹配英语和非英语字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆