About 123,000 results
Open links in new tab
  1. java - How to extract a substring using regex - Stack Overflow

    While substring looks for a specific string or value, regex looks for a format. It's more and more dynamic. You need regex, if you are looking for a pattern instead of a special value.

  2. How to use regex with String.matches in java - Stack Overflow

    Aug 16, 2017 · How to use regex with String.matches in java Asked 8 years, 3 months ago Modified 8 years, 2 months ago Viewed 27k times

  3. regex - Using regular expressions to extract a value in Java - Stack ...

    What I'm really interested in are the Java calls to take the regex string and use it on the source data to produce the value of [some number]. I should add that I'm only interested in a single …

  4. regex - How to escape text for regular expression in Java ... - Stack ...

    Sep 12, 2008 · 363 Does Java have a built-in way to escape arbitrary text so that it can be included in a regular expression? For example, if my users enter "$5", I'd like to match that …

  5. java - Check if a String matches specific regular expression - Stack ...

    Nov 26, 2013 · I am not so good with regular expressions and stuff, so I need help. I have to check if a input value matches a specific regular expression format. Here is the format I want …

  6. java - Use String.split () with multiple delimiters - Stack Overflow

    The string you give is the string form of a regular expression, so: private void getId(String pdfName){ String[] tokens = pdfName.split("[-.]"); // ... } That means "split on any character …

  7. Java - Extract strings with Regex - Stack Overflow

    Jan 1, 2010 · The regular expression means "a string containing a word, a space, one or more digits (which are captured in group 1), a space, a set of words and spaces ending with a …

  8. Java String.split() Regex - Stack Overflow

    Mar 25, 2012 · You could just split by spaces in your example expression to get the result you want.

  9. How to check if a string contains only digits in Java?

    In Java for String class there is a method called matches. How to use this method to check if my string has only digits using regular expression? I tried with below examples, but both of them …

  10. Escaping special characters in Java Regular Expressions

    May 19, 2012 · The 4 slashes in the Java string turn into 2 slashes in the regex pattern. 2 backslashes in a regex pattern matches the backslash itself. Prepending any special character …