cancel
Showing results for 
Search instead for 
Did you mean: 

How to check wether it text /alphabets or not

ChetanNinghot
Level 4
Hi
I have small daut
I have input like ABQ1268899
I want check total character and first 3 are alphabet and remaining 7 are number           I know how to check wether number and length but i have some dout about how to check alphabetes

------------------------------
Chetan Ninghot
------------------------------
1 BEST ANSWER

Best Answers

@Chetan Ninghot

Further to what @PvD_SE had said about using Regex, you can use the "Test Regex Match" action in BP's "Utility - Strings" VBO. You can use a regex pattern of:

"^[a-zA-Z]{3}[0-9]{7}$"

This will take care of both your length testing and character matching. The breakdown of the pattern is:

^ - start of the line
[a-zA-Z] - match any letter
{3} - match three of the previous specified characters
[0-9] - match any numbers (before anybody says anything, no, "\d" does not always mean the same as "[0-9]" in .Net)
{7} - match seven of the previous specified characters
$ - end of line

​​------------------------------

Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------
Micheal Charron
RBC
Toronto, Ontario
Canada

View answer in original post

5 REPLIES 5

PvD_SE
Level 12
Hi C,

Unfortunately, there's no IsAlfa() function in BP, like there is a IsNumeric() function. In this case, I'd suggest using regex, an object to work with regex should already be available in you BP installation. 

It would be easiest if you split the string in the first 3 and the last 7 chars. The first 3 chars you can check using Regex. If you google 'regex check alphanumeric' or similar, you'll get many pages describing what you want to know. 

If you want to know more about regex, I'd suggest this page, or perhaps this one.

------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi
Paul
Thank a lot for your valuable response
I am trying to used given link page


------------------------------
Chetan Ninghot
------------------------------

@Chetan Ninghot

Further to what @PvD_SE had said about using Regex, you can use the "Test Regex Match" action in BP's "Utility - Strings" VBO. You can use a regex pattern of:

"^[a-zA-Z]{3}[0-9]{7}$"

This will take care of both your length testing and character matching. The breakdown of the pattern is:

^ - start of the line
[a-zA-Z] - match any letter
{3} - match three of the previous specified characters
[0-9] - match any numbers (before anybody says anything, no, "\d" does not always mean the same as "[0-9]" in .Net)
{7} - match seven of the previous specified characters
$ - end of line

​​------------------------------

Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------
Micheal Charron
RBC
Toronto, Ontario
Canada

Hii
Micheal
Thank you for response
Your expression will directly helpful
For my input ABQ8769876
I will check it


------------------------------
Chetan Ninghot
------------------------------

Thanks for sharing the solution @MichealCharron  ​

------------------------------
Ritansh Jatwani
Manager
Deloitte
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------