You are viewing limited content. For full access, please sign in.

Question

Question

Connector - Regular Expression(Pattern matching)

asked on February 1, 2023

Hi All,

I am working  on a web page to extract values via connector. I having issue with pattern matching.

1. ID number - %(T Number;#<\s*(T\d\d\d\d\d\d\d\d)>#) - T02345194

2. Name - want to extract the name and remove the number - can any one help me with the pattern matching

 

 

Thanks 

Mano

0 0

Replies

replied on February 1, 2023 Show version history

Am I understanding this correctly?  You are working with a string of text that will look something like this: 

ID: T02345194 Dhaliwal, Amarpreet K.

 

And from that string of text, you want to extract two values: the ID number and the name.  Like this:

T02345194
Dhaliwal, Amarpreet K.

 

If that's correct, then you probably just need something along these lines. 

(T\d{8})\s+.+
T\d{8}\s+(.+)

 

That's a pretty basic set-up, so it is making a lot of assumptions about the fact that the string will be pretty similar every time.  If there is a lot of variation, or other values around this string, then the RegEx will likely need to be more robust/complex.

Note - I used https://regex101.com/ to test these.  It also explains each part of the expression.

1 0
replied on February 2, 2023

Thanks Matthew, will try with my string.

 

Thanks 

Mano

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.