VanjaV
February 17, 2025, 1:55pm
1
Hi,
I need Regex for following expression: 999,99 XY.
Explanation:
there can be up to 3 digits before comma
there can be 1 or 2 digits after comma
there can be 1 or more spaces betwen last number and “XY”
“XY” are two fixed characters.
Can someone help me, please?
Thx and KR, Vanja
@VanjaV
Try with this regex:
^\d{1,3},\d{1,2}\s+XY$
1 Like
Parvathy
(PS Parvathy)
February 17, 2025, 1:59pm
3
Hi @VanjaV
You can try below regular expression:
[0-9]+[,]?[0-9]+\s*[A-Z]{2}
Hope it helps!!
1 Like
singh_sumit
(Sumit Singh Tariyal)
February 17, 2025, 2:00pm
4
Hey @VanjaV can you try with this syntax
System.Text.RegularExpressions.Regex.Match( STRINPUT,“^\d{1,3},\d{1,2}\s+XY$”).ToString
cheers
1 Like
mkankatala
(Mahesh Kankatala)
February 17, 2025, 2:02pm
5
Hi @VanjaV
You can use the below regular expression to achieve every point you mentioned,
\d{1,3}\,\d{1,2}\s*XY
→ \d{1,3} - It will extract one to three digits before comma
→ , - Extracts comma
→ \d{1,2} - It will extract one or two digits after comma
→ \s* - It will extract the spaces between digits and XY (Space will be one or more)
→ XY - It will extract XY (It is static everytime)
Hope it helps!!
1 Like
system
(system)
Closed
February 20, 2025, 2:02pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.