Add Dash to Java Regex

I am trying to modify an existing Regex expression being pulled in from a properties file from a Java program that someone else built. The current Regex expression used to match an email address is - RR.emailRegex=^[a-zA-Z0-9_\.]+@[a-zA-Z0-9_]+\.[a-zA-Z0-9_]+$ That matches email addresses such as abc.xyz@example.com , but now some email addresses have dashes in them such as abc-def.xyz@exampl

将短划线添加到Java正则表达式

我试图修改从其他人构建的Java程序的属性文件中提取的现有Regex表达式。 用于匹配电子邮件地址的当前正则表达式是 - RR.emailRegex=^[a-zA-Z0-9_\.]+@[a-zA-Z0-9_]+\.[a-zA-Z0-9_]+$ 它匹配诸如abc.xyz@example.com等电子邮件地址,但现在有些电子邮件地址中包含破折号,例如abc-def.xyz@example.com,并且这些地址不符合正则表达式匹配。 我的新正则表达式是什么将这个正则表达式匹配添加到破折号还是有更好的方式来表示

Extracting Names and Email address from String with regex

I have been trying to extract the names and email addresses from the following String that consists of multiple lines through regex in Java: From: Kane Smith <Kane@smith.com> To: John Smith <john@smith.com>, Janes Smith <jane@smith.org>, Tom Barter <tom@test.co.uk>, Other Weird @#$@<>#^Names <other@names.me>, Long Long Long Long Name <longlong@

使用正则表达式从字符串中提取姓名和电子邮件地址

我一直试图通过Java中的正则表达式从以下由多行组成的字符串中提取名称和电子邮件地址: From: Kane Smith <Kane@smith.com> To: John Smith <john@smith.com>, Janes Smith <jane@smith.org>, Tom Barter <tom@test.co.uk>, Other Weird @#$@<>#^Names <other@names.me>, Long Long Long Long Name <longlong@name.com> Date: Tue, 25 Oct 2011 15:45:59 +0000 我试

Converting image X,Y coordinates to longitude and latitude?

I have set values of minimum longitude and latitude of a specific static map image. That map image is a cut of some country. /** * Maximum longitude value of the map */ private float mapLongitudeMax; /** * Minimum longitude value of the map */ private float mapLongitudeMin; /** * Maximum latitude value of the map */ private float mapLatitudeMax; /** * Minimum latitude value of the map

将图像X,Y坐标转换为经度和纬度?

我已经设置了特定静态地图图像的最小经度和纬度值。 该地图图像是某个国家的剪辑。 /** * Maximum longitude value of the map */ private float mapLongitudeMax; /** * Minimum longitude value of the map */ private float mapLongitudeMin; /** * Maximum latitude value of the map */ private float mapLatitudeMax; /** * Minimum latitude value of the map */ private float mapLatitudeMin; 我有一个名

mail field using regex

I need to check if a string (local part of email address) has nothing except: letters (a-zA-Z) numbers (0-9) underscores at most one dot (.) How do I do it using Java regex ? Example: a_1_b.c and a_b_1 , should be okay ,but 1.a_b.2 and 1_a*3 should be discarded. If you want to verify email correctness you might want to just rely on the JavaMail API to do it for you. Then you don

邮件字段使用正则表达式

我需要检查一个字符串(电子邮件地址的本地部分)是否除了: 字母(a-zA-Z) 数字(0-9) 下划线 最多一个点(。) 我该如何使用Java regex ? 例如: a_1_b.c和a_b_1应该没问题,但应该丢弃1.a_b.2和1_a*3 。 如果你想验证电子邮件的正确性,你可能只想依靠JavaMail API来为你做。 然后,您不必担心将RFC 822规范的细节编码为正则表达式。 更不用说,如果你正在处理电子邮件地址,你可能想要一个简单的方式发送

Email validator regex

Possible Duplicate: Regexp recognition of email address hard? Hi, I would like to implement validator for only local part of the email address. Any suggestions please welcome. From the Email address article at wikipedia (Syntax section): The local-part of the email address may use any of these ASCII characters: Uppercase and lowercase English letters (a–z, A–Z) Digits 0 to 9 Cha

电子邮件验证器正则表达式

可能重复: 正则表达式很难识别电子邮件地址? 嗨, 我想仅为电子邮件地址的本地部分实施验证器。 任何建议,请欢迎。 来自维基百科的电子邮件地址文章(语法部分): 电子邮件地址的本地部分可能使用以下任何ASCII字符: 大写和小写英文字母(a-z,A-Z) 数字0到9 人物! #$%&'* + - / =? ^ _`{| }〜 性格。 (点,句号,句号),前提是它不是第一个或最后一个字符,并且规定它不会连续出现

Regular expression matching fully qualified class names

What is the best way to match fully qualified Java class name in a text? Examples: java.lang.Reflect , java.util.ArrayList , org.hibernate.Hibernate . A Java fully qualified class name (lets say "N") has the structure N.N.N.N The "N" part must be a Java identifier. Java identifiers cannot start with a number, but after the initial character they may use any combination

正则表达式匹配完全限定的类名

在文本中匹配完全限定的Java类名的最佳方式是什么? 示例: java.lang.Reflect , java.util.ArrayList , org.hibernate.Hibernate 。 Java完全限定的类名称(可以说是“N”)具有结构 N.N.N.N “N”部分必须是Java标识符。 Java标识符不能以数字开头,但在初始字符之后,它们可以使用字母和数字,下划线或美元符号的任意组合: ([a-zA-Z_$][a-zA-Zd_$]*.)*[a-zA-Z_$][a-zA-Zd_$]* ------------------------ ------------

How to ignore checkstyle on methods according to a specific pattern

Is there a way for the checkstyle rule MethodLength to set a pattern for methods to be ignored? I want to suppress the checkstyle rule for all methods named getMetaInformation() . Other checkstyle rules like LineLength have the property <property name="ignorePattern" value=""/> but this seems not to be available for the MethodLength rule (see http://checkstyle.sou

如何根据特定模式忽略方法的checkstyle

有没有办法让checkstyle规则MethodLength为要忽略的方法设置一个模式? 我想压制所有名为getMetaInformation()方法的checkstyle规则。 其他Checkstyle规则如LineLength具有该属性 <property name="ignorePattern" value=""/> 但是这似乎不适用于MethodLength规则(请参阅http://checkstyle.sourceforge.net/apidocs/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheck.html)。

How to define program's requirements

Is there any easy, cheap (which don't require to test program on many hardware configuration) and painless method to define hardware requirements (like CPU, RAM memory etc), that are require to run my own program? How it's should be done? I have quite resource-hungry program written in Java and i don't know how to define hardware specification that will be enough to run this aplica

如何定义程序的要求

是否有任何简单,便宜(不需要在许多硬件配置上测试程序)以及定义硬件需求(如CPU,RAM存储器等)的无痛方法,这些都需要运行我自己的程序? 应该怎么做? 我有用Java编写的相当资源匮乏的程序,我不知道如何定义足以顺利运行这个应用程序的硬件规范。 不,我认为没有任何通用的方法可以确定不涉及某些特定参考硬件测试的最低要求。 您可以通过使用某种虚拟机来找到某些限制 - 修改某些虚拟机的参数比修改硬件更容易。

What needs to be signed?

I'm deploying a JavaFX application and am not quite sure what does and doesn't need to be signed. Here are my thoughts: - Installation file: This obviously needs to be signed. - The EXE that launches the application: I believe this needs to be signed, although it feels a little bit funny because it isn't my code. - My JAR files: I believe that these also need to be signed, alth

需要签署什么?

我正在部署一个JavaFX应用程序,我不太确定哪些内容需要签名。 这是我的想法: - 安装文件:这显然需要签名。 - 启动应用程序的EXE:我认为这需要签名,但它感觉有点有趣,因为它不是我的代码。 - 我的JAR文件:我相信这些也需要签名,但我不确定是否会发生任何可怕的事情,如果我不这样做。 - 我从互联网上抓取的图书馆JAR:我不觉得我应该签署这些。 有什么理由吗? - Java运行时:我猜这是没有理由的,如果我这

Exception while adding contact in google.Internal server Error

We have been getting the following error from today morning onwards while inserting the contacts through Google API from java. Please find the stack trace below Exception while adding contact in google.... com.google.gdata.util.ServiceException: Internal Server Error A temporary internal problem has occurred. Try again later. at com.google.gdata.client.http.HttpGDataRequest.handleErrorRe

在google.Internal服务器中添加联系人时出现异常错误

从今天早上起,我们从Java中通过Google API插入联系人时收到以下错误。 请在下面找到堆栈跟踪 Exception while adding contact in google.... com.google.gdata.util.ServiceException: Internal Server Error A temporary internal problem has occurred. Try again later. at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:624) at com.google.gdata.client.http.Goo