0

using regex I need to match attributes that begins with a number, might contain a slash and might contain a letter as well. Because I am a beginner I don't know how to even start. These attributes are data elements from a database table. For example I would like to match all these following data:

54/6
66A
75

1 Answer 1

1

This regexp could help to you. (https://regex101.com/r/sJ8tB6/1)

(^[0-9A-Za-z\/]+)

^ = start with
0-9 = any number
A-Z = any letter is uppercase
a-z = any letter in lowercase
/ = and the slash, but you need to escape this with the backslash \
+ = one or more match.

you can go to this site, and see the example. https://regex101.com/r/sJ8tB6/1

Regards.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.