This is a general regex question,although I will apply it in PHP.
I am trying to find all files that DO NOT contain strings like -123x456
or -12345x678
meaning that the format is always -INT
xINT
. (like image resolution) .
This string is a part of the filename. and the "constsnts" are the minus ( - ) sign before the string and the X in the middle ( which can be both capital letters or not )
With the help of THIS have come up with the expression:
^(?:(?!STRING).)*$
or in my case :
^(?:(?!x).)*$
But that will exclude all filenames that contain an x
How can I add the Numbers on both sides of the x
when not knowing how many digits they are , but knowing that there COULD be a number before or after that is a part of the filename
(e.g. myfile-x1-456x78
9 VR. myfile-x12
)
I need a separate solution for x
in specific , or for X | x
...