This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision |
kb:zapisi:regex_main [2023/08/16 09:07] – [Back-references — 1] milano | kb:zapisi:regex_main [2023/08/16 09:11] (current) – [Pogled napred i pogled iza — (?=) i (?<=)] milano |
---|
| |
| |
===== Look-ahead and Look-behind — (?=) and (?<=) ===== | ===== Pogled napred i pogled iza — (?=) i (?<=) ===== |
''d(?=r)'' matches a ''d'' only if it is **followed by r**, but ''r'' will not be part of the overall regex match. \\ | ''d(?=r)'' odgovara „d“ samo ako ga **prati r**, ali „r“ neće biti deo ukupnog podudaranja regularnog izraza. \\ |
''(?<=r)d'' matches a ''d'' only if it is **preceded by an r**, but r will not be part of the overall regex match. \\ | ''(?<=r)d'' odgovara „d“ samo ako mu **prethodi r**, ali r neće biti deo ukupnog podudaranja regularnog izraza. \\ |
| |
You can use also the negation operator! | Možete koristiti i operator negacije! |
| |
''d(?!r)'' matches a ''d'' only if is **not followed by r**, but r will not be part of the overall regex match. \\ | |
''(?<!r)d'' matches a ''d'' only if is **not preceded by an r**, but r will not be part of the overall regex match. | |
| |
| ''d(?!r)'' odgovara „d“ samo ako **ne prati r**, ali r neće biti deo ukupnog podudaranja regularnog izraza. \\ |
| ''(?<!r)d'' odgovara „d“ samo ako mu **ne prethodi r**, ali r neće biti deo ukupnog podudaranja regularnog izraza. |