I have an Ordernumber that looks like this: 1001-00001.2
but I want it without the extra .2
I tried to use the following in my code:
{$sArticle.ordernumber|regex_replace:"/'.'/\d":" "}
it didn't work because I don't know how I can use the dot.
Dot matches any single character. Try escaping it:
{$sArticle.ordernumber|regex_replace:"/\.\d+$/":""}
There's actually a few changes, here.
/.../
that mark a regex\
.+
) was added to \d
so it matches one or more digits.$
) is used to make sure it doesn't match anywhere but the end of the string.