lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Le 14/03/2013 00:50, Duncan Cross a écrit :
> On Wed, Mar 13, 2013 at 11:19 PM, Laurent Faillie <l_faillie@yahoo.com> wrote:
>> I would like to do
>>      string.gsub("blabla/in0_input", "_input", "_alarm")
>>
>> but I need to ensure the "_input" is really at the end of the string
> Well, this will only work if you really do mean "at the end of the
> string", and not just the last occurrence:
>
>      string.gsub("blabla/in0_input", "_input$", "_alarm")
>
> The '$' character indicates that this search pattern only matches at
> the end of the string.
Great, it's what I was looking for :)

Thanks