Skip to main content
Solved

Position based selection by attribute values


rakeshreddy0996
Forum|alt.badge.img

i have to select based on position

select based on positions like first position Alpha and second position numeric or first two alphabets and last numeric

HSNAFD151212114A15A10ABBAC501D1D2D5D

is there any possibility to select yellow highlighted vales based on above parameters

 

Thanks in advance

Best answer by danullen

To select the yellow values I would use a Tester with two lines of Contains Regex:

 

^\\d\\d[A-Z]$

 

^\\d[A-Z]$

The first regex says "from start of string (^), two digits (\\d\\d) followed by one capital letter ([A-Z]) and nothing more ($).

View original
Did this help you find an answer to your question?

7 replies

Forum|alt.badge.img
  • Best Answer
  • September 6, 2019

To select the yellow values I would use a Tester with two lines of Contains Regex:

 

^\\d\\d[A-Z]$

 

^\\d[A-Z]$

The first regex says "from start of string (^), two digits (\\d\\d) followed by one capital letter ([A-Z]) and nothing more ($).


ebygomm
Influencer
Forum|alt.badge.img+33
  • Influencer
  • September 6, 2019

A string searcher with the following regular expression (match 1 or 2 digits followed by 1 letter). Features that match the expression exit via the matched port

^\d{1,2}[A-Z]{1}$

Forum|alt.badge.img
  • September 6, 2019
ebygomm wrote:

A string searcher with the following regular expression (match 1 or 2 digits followed by 1 letter). Features that match the expression exit via the matched port

^\d{1,2}[A-Z]{1}$

I was a bit uncertain about which other accepted combinations might appear in the OP's data, but if it's only these two variants then egomm's solution is of course slimmer and more direct.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • September 6, 2019
danullen wrote:

To select the yellow values I would use a Tester with two lines of Contains Regex:

 

^\\d\\d[A-Z]$

 

^\\d[A-Z]$

The first regex says "from start of string (^), two digits (\\d\\d) followed by one capital letter ([A-Z]) and nothing more ($).

 

@egomm @danullen

@rakeshreddy0996 said "first position Alpha and second position numeric or first two alphabets and last numeric "

 

Wich is (literaly)

^[a-zA-Z]\\d.*$

and

^[a-zA-Z]{2}.*\\d$

 

You guys answer selection shown in the picture, which is not in accoredance with the question....

(or you can say this issue has 2 questions)

Also:

^\\d{1,2}[A-Z]$

Splitting in 2 regexps is not necessary.

The last {1} is superfluous.


ebygomm
Influencer
Forum|alt.badge.img+33
  • Influencer
  • September 6, 2019
gio wrote:

 

@egomm @danullen

@rakeshreddy0996 said "first position Alpha and second position numeric or first two alphabets and last numeric "

 

Wich is (literaly)

^[a-zA-Z]\\d.*$

and

^[a-zA-Z]{2}.*\\d$

 

You guys answer selection shown in the picture, which is not in accoredance with the question....

(or you can say this issue has 2 questions)

Also:

^\\d{1,2}[A-Z]$

Splitting in 2 regexps is not necessary.

The last {1} is superfluous.

Well, the last part of the question said "is there any possibility to select yellow highlighted vales based on above parameters?" so that's the question we've answered :-)


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • September 6, 2019

@egomm

@danullen

 

Almost...;)

For he says, note the bold part...:

"

is there any possibility to select yellow highlighted vales based on above parameters"

 

The answer would be : "NO"

 


Forum|alt.badge.img
  • September 6, 2019
ebygomm wrote:

Well, the last part of the question said "is there any possibility to select yellow highlighted vales based on above parameters?" so that's the question we've answered :-)

Yes, the question and the example wasn't in accordance as I saw it, so I went for the example and thought I'd leave a wide open door for the OP's applications of the regex search. I'm a "teach a man how to fish"-kind of guy. :-)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings