digit « Match « Java Regex Q&A

Home
Java Regex Q&A
1.Development
2.find
3.group
4.Match
5.matcher
6.number
7.Operation
8.parse
9.Pattern
10.replace
11.validation
12.word
Java Regex Q&A » Match » digit 

1. Java regular expression to identify strings with more digits than non-digits    stackoverflow.com

How can I identify strings containing more digits than non-digits using regular expression (Pattern) in Java? Thank you.

2. Help on a better way to parses digits from a String in Java    stackoverflow.com

I have a string which contains digits and letters. I wish to split the string into contiguous chunks of digits and contiguous chunks of letters. Consider the String "34A312O5M444123A". I would like ...

3. Increment digit value in String    stackoverflow.com

So, i have some String with digits and another symbols, and i want to increment the value of each digit at 1. For example: "test1check2" from this String i ...

4. Regex for checking > 1 upper, lower, digit, and special char    stackoverflow.com

^.*(?=.{15,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*+=]).*$
This is the regex I am currently using which will evaluate on 1 of each: upper,lower,digit, and specials of my choosing. The question I have is how do I make ...

5. regex: trim all strings directly preceeded by digit except if string belongs to predefined set of strings    stackoverflow.com

I've got addresses I need to clean up for matching purposes. Part of the process is trimming unwanted suffices from housenumbers, e.g:

mainstreet 4a --> mainstreet 4. 
However I don't want: ...

6. Regex matching "four characters, followed by an unknown No of digits."    stackoverflow.com

An example of how the Strings may look:

TADE000177
TADE007,daFG
TADE0277 DFDFG
Thank you!

7. Match "_string" wth a regular expression    stackoverflow.com

I have a list of strings like

  • xxx_2pathway
  • xxx_6pathway
  • xxx_pathway
So I have a string followed by an underscore and "pathway". There may be a digit between the underscore and "pathway". How can I match ...

8. What regex will match 4 digits, a period, then one and only one digit?    stackoverflow.com

I need a (Java) regular expression that will match:

XXXX.X
Where X is any number, only one number after the decimal point.

9. regex for specific digit prefix    stackoverflow.com

I am trying to have the following regx rule, but couldn't find solution. I am sorry if I didn't make it clear. I want for each rule different regx. I am using ...

10. Regex match digits, comma and semicolon?    stackoverflow.com

What's a regular expression that will match a string only containing digits 0 through 9, a comma, and a semi-colon? I'm looking to use it in Java like so:

word.matches("^[1-9,;]$") //Or something ...

11. Regular Expression to match one or more digits 1-9, one '|', one or more '*" and zero or more ','    stackoverflow.com

I'm new to regular expressions and I need to find a regular expression that matches one or more digits [1-9] only ONE '|' sign, one or more '*' sign and zero ...

12. regex again - allow only 11 digits.    coderanch.com

13. Regex for a combination of digits and space    coderanch.com

Hi, Currently I am working on a regex that should accomodate input as 123456789 (space characters can be multiple) - (space characters can be multiple) 22343434343 So its a hypen separated range, that has to have a combination of digits and space characters (space characters can be zero or any number of times.) I have got a regex like this [0-9]{0,15}\\s*-\\s*[0-9]{0,15}\\s* ...

14. Regex 5 digits or more in a string    forums.oracle.com

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.