String Extraction from a certain word from a line

Hi ,

I want to extract string of length (6 )after the word ‘visa’ from a line.

Any solution for this?

try this
visa\s(\w{6})

Hi @Lakshmi_Tiliconveli

You can use the below one,

(?<=visa\s?)[\s\S]{6}

Hope it helps!!

hello @Lakshmi_Tiliconveli
you can use
(?<=visa)\w{6}

Forum_regex_new

regards,
Dheerendra Vishwakarma

Thanks Maheswar .

But Sometimes it may be Visa: H1B or Visa Status: H4EAD. Then how to extract the visa names here eg. I just need only H1B, H4EAD like that.

use this: (?:Visa:|Visa Status:)\s*(\w+)

Hi @Lakshmi_Tiliconveli

Try this

(?<=:\s+)\w+

@Lakshmi_Tiliconveli

System.Text.RegularExpressions.Regex.Match(Input,"(?<=:\s+)\w+").Value

Hey, @lrtetala I think this is not suitable @Lakshmi_Tiliconveli wants to extact only visa names the name which are after Visa: or Visa Status: , not the colon!

Using this “(?<=:\s+)\w+” it can extract all the values after “colon”

@Lakshmi_Tiliconveli Try this one!

(?<=Visa: )\s*(\w+)|(?<=Visa Status: )\s*(\w+)

Cheers!