Set regular expression condition


#1

I am screen scraping text from an image and i want to set a condition that it should be only alphanumeric if its not then retry screen scraping text.
For eg. if the text is A123 and the scraper scrapes A!23 then i should ask the scraper to scrape the file again since its not alphanumeric. Retry max of 3 times.


#2

@jamnanin,

Refer this, Answered ALREADY

Regards,
Dominic :slight_smile:


#3

Hi @jamnanin,

Use Is Match activity get
Properties
input->Give your input string
Pattern
^[a-zA-Z][a-zA-Z0-9]*$
Result ->you will get the Boolean value.

use while loop activity to loop through 3 times.

Regards,
Arivu


#4

Thanks arivu


#5

Thanks dominic


#6

Is there a way i can change the exclamation to 1 whenever it appears. eg. if it reads A128 as A!2B then ask it to change ! to 1 and 8 to B


#7

Hi @jamnanin,

If you want to all the time means you can replace the string value.
strValue=“A!2B”

strValue.Replace("!","1")
strValue.Replace("8","B")
or

strValue.Replace("!","1").Replace("8","B")

Regards,
Arivu


#8

@arivu96 Thanks