I know this topic is asked a lot but I couldn't find an answer to my question:
In the attached image there are many different buffers, and I wish to match only the buffers that have "Lut" in their names (notice there are 2 matches in the string in the image). The problem I have is that the matches contain also the buffers that come before the one I want.
I'm pretty new to regex and still trying to learn as much so any explanation will be appreciated.
Thank you! :)
The string is attached for you comfort (if needed):
<?xml version="1.0" encoding="utf-8"?>
<pimp xmlns:dt="urn:schemas-microsoft-com:datatypes">
<dllPath>C:\ReplayCode\Apps\Pimp</dllPath>
<buffers>
<buffer name="InputMask">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
<buffer name="MaskErode">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
<buffer name="BlablaLutBla">
<width>256</width>
<height>256</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
<buffer name="MaskClose">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
<buffer name="InputVis">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>3</channels>
<type>IMG</type>
</buffer>
<buffer name="AddMaskEdge">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
<buffer name="EdgeVis">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>3</channels>
<type>IMG</type>
</buffer>
<buffer name="GrayEdge">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
<buffer name="EdgeMaskMulThreshold">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
<buffer name="MaskMulEdge">
<width>5120</width>
<height>3072</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
</buffers>
The regex I tried is this:
<buffer name=".*?Lut.*?">.*?<\/buffer>
And I expected 2 matches:
<buffer name="BlablaLutBla">
<width>256</width>
<height>256</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>
and
<buffer name="2ndLutBlabla">
<width>256</width>
<height>256</height>
<data>UCHAR</data>
<channels>1</channels>
<type>IMG</type>
</buffer>