[A-z]
will match ASCII characters in the range from A
to z
, while [a-zA-Z]
will match ASCII characters in the range from A
to Z
and in the range from a
to z
. At first glance, this might seem equivalent — however, if you look at this table of ASCII characters, you’ll see that A-z
includes several other characters. Specifically, they are [
, \
, ]
, ^
, _
, and `
(which you clearly don’t want).
Related Posts:
- Using or ‘|’ in regex [duplicate]
- How to match “any character” in regular expression?
- Understanding regex in Java: split(“\t”) vs split(“\\t”) – when do they both work, and when should they be used
- How to match “any character” in regular expression?
- What does regular expression \\s*,\\s* do?
- Range of valid character for a base 64 encoding
- List of all special characters that need to be escaped in a regex
- Regular Expressions on Punctuation
- How to extract a substring using regex
- Whitespace Matching Regex – Java
- How to represent a fix number of repeats in regular expression?
- Using regex to match any character except =
- How to use regex in String.contains() method in Java
- Whitespace Matching Regex – Java
- Regex pattern including all special characters
- Use String.split() with multiple delimiters
- Split string into array of character strings
- Java regex email
- What’s the simplest way to print a Java array?
- javax vs java package
- What is a stack trace, and how can I use it to debug my application errors?
- How to fix “A JNI error has occurred, please check your installation.”
- Java Runtime Environment not found error when I open an application
- “PKIX path building failed” and “unable to find valid certification path to requested target”
- What exactly does a jar file contain?
- What is the best way to implement constants in Java?
- What is the reason behind “non-static method cannot be referenced from a static context”?
- What does ” || ” mean in Java? [duplicate]
- “Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G
- “int cannot be dereferenced” in Java
- Understanding Spring @Autowired usage
- What is a serialVersionUID and why should I use it?
- SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
- The difference between += and =+
- exception in initializer error in java when using Netbeans
- Switch on Enum in Java
- error upon assigning Layout: BoxLayout can’t be shared
- Why do this() and super() have to be the first statement in a constructor?
- Else without if
- Keytool is not recognized as an internal or external command
- Cannot find “Package Explorer” view in Eclipse
- Error: Could not find or load main class in intelliJ IDE
- Java Hashmap: How to get key from value?
- Understanding the difference between null and ‘\u000’ in Java
- what does Dead Code mean under Eclipse IDE Problems Section
- Java compressing Strings
- restart console on Minecraft Server
- SSL peer shut down incorrectly in Java
- Java split string to array
- How can I clear or empty a StringBuilder?
- Generate a random double in a range
- Eclipse “Error: Could not find or load main class”
- How to get locator of current web element?
- Cannot instantiate the type Queue. Why is this?
- Pause the timer and then continue it
- Converting String Array to an Integer Array
- How to fix “unsupported class file major version 60” in IntelliJ?
- Resize an Array while keeping current elements in Java?
- Access restriction: The type ‘Application’ is not API (restriction on required library rt.jar)
- Assign the negativeCntr with the number of negative values in the linked list
- intellij incorrectly saying no beans of type found for autowired repository
- Web server failed to start. Port 8080 was already in use. Spring Boot microservice
- No Persistence provider for EntityManager named
- What does it mean: JavaFX application class must extend javafx.application.Application?
- Using Math.round to round to one decimal place?
- How to replace a substring of a string
- How to check if object is null or not except == null
- How do I check if the user is pressing a key?
- How to check if object is null or not except == null
- Comparing strings by their alphabetical order
- exposed beyond app through ClipData.Item.getUri
- Java – get the current class name?
- Warning: The method assertEquals from the type Assert is deprecated
- koch snowflake java recursion
- Java word count program
- How to return a boolean method in java?
- Java read file and store text in an array
- MultipartException: Current request is not a multipart request
- How to “wait” a Thread in Android
- Error: Module not specified (IntelliJ IDEA)
- Checking letter case (Upper/Lower) within a string in Java
- Size has private access in ArrayList
- Iterator for a linkedlist
- Hide Utility Class Constructor : Utility classes should not have a public or default constructor
- Android – Start service on boot
- JsonMappingException: No suitable constructor found for type [simple type, class ]: can not instantiate from JSON object
- Sending POST data in Android
- When is “java.io.IOException:Connection reset by peer” thrown?
- Java ArrayList of Doubles
- what is update-alternatives command in linux and what is the use of it?
- How to extract .war files in java? ZIP vs JAR
- What is the difference between run-time error and compiler error?
- What is the difference between ArrayList.clear() and ArrayList.removeAll()?
- Test if element is present using Selenium WebDriver?
- Increase heap size in Java
- android.content.res.Resources$NotFoundException: String resource ID #0x0
- what does x– or x++ do here?
- Spring Boot – Cannot determine embedded database driver class for database type NONE
- Convert double to float in Java
- Can’t seem to disable Java Automatic Update