013-004-003

Pattern Class: Letter Check

Easy

Problem Description

Pattern class: Letter Check

In this problem, you will create a program that uses Pattern.matches with the regular expression pattern [a-zA-Z]+ to determine whether an input string consists only of letters, and displays the result to standard output.

Learning Objective: Check letters only with regex

Create program checking if input string consists only of letters. Check letter pattern [a-zA-Z]+ with Pattern.matches.

Input

Line 1: String to check (String)

Output

Input: [input string]
Letters only: [true/false]
```java

## Examples

### Example 1: Letters only
Input:
```java
Hello
```java
Output:
```java
Input: Hello
Letters only: true
```java

### Example 2: Letters and numbers mixed
Input:
```java
Hello123
```java
Output:
```java
Input: Hello123
Letters only: false
```java

### Example 3: Boundary (1 character)
Input:
```java
A
```java
Output:
```java
Input: A
Letters only: true

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up