Bản mẫu này sử dụng Lua: |
Wrapper template for function posnq in Module:String2.
|source=
), which is trimmed.|target=
), which is trimmed and any double quotes " are stripped out. That allows spaces at the beginning or end of the match string to be included in a consistent manner.|plain=
), which is trimmed. If it's set to false, then the search accepts Lua pattern-matching for the target, otherwise a plain search is used.|nomatch=
), which is trimmed. This value is returned if no match occurs. Setting |nomatch=0
makes the output compatible with the find function in Module:String.{{Posnq |This is a piece of text to be searched |piece of }}
→ 11{{Posnq |This is a piece oftext to be searched |piece of }}
→ 11{{Posnq |This is a piece of text to be searched |"piece of "}}
→ 11{{Posnq |This is a piece oftext to be searched |"piece of "}}
→{{posnq |This is a piece of text to be searched |ext}}
→ 21{{posnq |This is a piece of text to be searched |ent}}
→{{posnq |This is a piece of text to be searched |" pie"}}
→ 10{{posnq |This is a piece of text to be searched |" ece"}}
→{{posnq |source=This is a piece of text |target=ece}}
→ 13{{posnq |source=This is a piece of text |target=%s |plain=true}}
→{{posnq |source=This is a piece of text |target=%s |plain=false}}
→ 5{{posnq |source=This is a piece of text |target=ece |nomatch=0}}
→ 13{{posnq |source=This is a piece of text |target=xyz |nomatch=0}}
→ 0{{posnq |This is a piece of text |" of" |true |0}}
→ 16{{posnq |This is a piece of text |" of" |true |0}}
→ 0{{posnq |source=Meet at Café Nero |target=afé}}
→ 10