Hi,
I need a subject, sometimes Extral, sometimes something else.
This my Code
System.Text.RegularExpressions.Regex.Matches(Currentitem.Subject.toString,“(?<=LCM-)(.)(:)(?=Extral)”)(0).ToString.Replace(" “,”")
Hi,
I need a subject, sometimes Extral, sometimes something else.
This my Code
System.Text.RegularExpressions.Regex.Matches(Currentitem.Subject.toString,“(?<=LCM-)(.)(:)(?=Extral)”)(0).ToString.Replace(" “,”")
Hi @punnipah
Can you share the sample Input and expected output?
the sample
Memo number STO 00835/2022(1) Subject LCM-C Extralxxxxx
Memo number STO 00835/2022(1) Subject LCM-C Starxxxxx
expected output
LCM-C Extral
LCM-C Star
HI @punnipah
How about this following?
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=Subject\s)\S.*(?=x{5})").Tostring
Regards
Gokul
Sorry I might misunderstand you.
I want the C value in the middle.
Ahead is LCM-behind is Extral Or Star
HI @punnipah
Check out this expression?
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=LCM\W)\S.*(?=\sExtral|\sStar)").Tostring
If there is no Extral or Star next time, will it work?
I can’t say that I’ll always have these two words.
Every time it will be a Single Letter? @punnipah
Like C
try this @punnipah
(LCM-C [A-Za-z]+)
e.g. input is
Memo number STO 00835/2022(1) Subject LCM-C Extral
output of
System.Text.RegularExpressions.Regex.Match(Currentitem.Subject.toString,"(LCM-C [A-Za-z]+)").Groups(1).Value
is
LCM-C Extral
Not Single Letter
Thank you So much ^^
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.