Buen día Colegas
Solicito de su amable colaboración de si me pueden guiar para extraer las cadenas de texto por medio de regex
Deseo Extraer en una Variable lo que esta en cursiva y en otra variable lo que esta en Negrilla.
trate de hacerlo así pero solo me toma un valor
(?<=\s)\d.?(([^()]\d*[^()]*))
Fenpicoxamida 5% p/v (50 g/L)
Protioconazol 10% p/v (100 g/L)
Coformulantes c.s.p 100% p/v (1 L)
Espiromesifeno…24,0% p/v (240 g/L)
Coformulantes c.s.p. … 100% p/v (1 L)
Agradezco de su ayuda.
Hey!
Try this
System.Text.RegularExpressions.RegEx.Match(StrInputVariable,"\d.*$").ToString
Regards,
NaNi
ppr
(Peter Preuss)
3
with a little luck following can work:

then we refer to the groups:
so in 1 match we access first and second info
[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum
Muchas gracias, sin embargo no funciona
en esta imagen se puede apreciar el texto completo

usando el Regex, me extrae solo la primera linea, y lo que necesito son los valores en diferentes variables


en una variable quiero obtener
5% p/v (50 g/L)
10% p/v (100 g/L)
100% p/v (1 L)
y en otra Variable
Fenpicoxamida
Protioconazol
Coformulantes c.s.p
Hola NANI
Gracias, no funciono

usando tu expresión solo obtengo un valor de los 3 que quiero obtener


en una variable quiero obtener
5% p/v (50 g/L)
10% p/v (100 g/L)
100% p/v (1 L)
y en otra Variable
Fenpicoxamida
Protioconazol
Coformulantes c.s.p
ppr
(Peter Preuss)
6
Kindly note the difference between Match and Matches function
You used Match and therefore only the first Match is catched
When using Matches all found Matches will be kept
Also have a look above at:
- the Linked CheatSheet - listing it
- the group approach where both parts are retrived and can be assigned to variables
also have a look here:
we usewd the regexoption.Multiline and get all
And here were can catch all in a string array separated list
System.Text.RegularExpressions.Regex.Matches(strText,strPattern, RegexOptions.Multiline).Cast(Of Match).Select(Function (m) {m.groups(1).Value,m.groups(2).Value}).ToList
Hey!
In this case use Matches activity and provide the expression in the values field select advance option.
Create one output variable
Pass this variable in for each. In each iteration you’ll get the values
Regards,
NaNi