number scanner settings

  • 54 Views
  • Last Post 4 weeks ago
tahasamar posted this 17 July 2018

 

hi 

here the app looks for a 16-digits number , but what i need is to scan for a number like this :

"1234 5678 9123 4567"

 

i mean 4 part of 4-digit numbers ; so what do i have to write in this line of the code.

 

please answer me .i have to complate my app in these three days 

 

Order By: Standard | Newest | Votes
Koen de Leijer posted this 17 July 2018

Hi

You could try something like

^(\d{4}\s\d{4}\s\d{4}\s\d{4})

As said by https://regex101.com/

/ ^(\d{4}\s\d{4}\s\d{4}\s\d{4}) / gm
^ asserts position at start of a line 1st Capturing Group (\d{4}\s\d{4}\s\d{4}\s\d{4}) \d{4} matches a digit (equal to [0-9]) {4} Quantifier — Matches exactly 4 times \s matches any whitespace character (equal to [\r\n\t\f\v ]) \d{4} matches a digit (equal to [0-9]) {4} Quantifier — Matches exactly 4 times \s matches any whitespace character (equal to [\r\n\t\f\v ]) \d{4} matches a digit (equal to [0-9]) {4} Quantifier — Matches exactly 4 times \s matches any whitespace character (equal to [\r\n\t\f\v ]) \d{4} matches a digit (equal to [0-9]) Global pattern flags
g modifier: global. All matches (don't return after first match) m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)

  More information: https://www.regular-expressions.info/quickstart.html   Best regards Koen de Leijer

Oksana Serdyuk posted this 18 July 2018

Hi,

Please also find the information about all supported syntax in the Regular Expressions section of the RTR SDK documentation.

tahasamar posted this 5 weeks ago

 thanks for your answers ;

i found this :

\\w\\w\\w\\w\\040\\w\\w\\w\\w\\040\\w\\w\\w\\w\\040\\w\\w\\w\\w

 

it works as i want , but i need some thing that works with every kind of 16-digit numbers with or without spaces every where contains all of this kinds:

1234 4567 1234 3466

1 234 567 891 234 567

1234567891234567

 or...

 

if its not possible , say me :(

Oksana Serdyuk posted this 4 weeks ago

Hi,

Please try this one regular expression:

([0-9]|\040){16,}

Close