• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

info between **

I have the following string:

JE: ** Job . a1:311 a2:565 a3:1204 --- ty, 311762, --- a5, 31178747, --- b3, 31178384, ---a7, 31178381, --- a1, 15808387, --- ty, 3184, --- a5, 12045-05, ** Job a1:31321 a2:5654 a3:1204 --- ty, 311762, --- a2, 3117678747, ---a5, 3113378384, --- a1, 3117yy658381, --- ty, 158533308387, --- ty, 334184, --- a5, 120456-05,

I have the following RegEx:

(?<=--- ty, ).*?(?=,)

It give me all the ty numbers, but i need only the ti's numbers that are between the first ** and the second **
0
joyacv2
Asked:
joyacv2
  • 2
1 Solution
 
Dan CraciunIT ConsultantCommented:
(?<=--- ty, )\d*(?=.*\*)

Open in new window

Or, if you want to keep your original regex, just add the forward lookup. It will match as long as there is a "*" ahead.
(?<=--- ty, ).*?(?=,)(?=.*\*)

Open in new window

HTH,
Dan
0
 
joyacv2Author Commented:
Thanks Dan, works perfect!!!!
0
 
Dan CraciunIT ConsultantCommented:
You're welcome.

Glad I could help!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now