kb:zapisi:regex_main

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
kb:zapisi:regex_main [2023/08/15 14:45] – [Greedy and Lazy match] milanokb:zapisi:regex_main [2023/08/16 08:58] – [Pohlepni i lenji se poklapaju] milano
Line 101: Line 101:
 Kvantifikatori ( ''* + {}'') su *pohlepni operatori*, tako da proširuju podudaranje koliko god mogu kroz dati tekst. Kvantifikatori ( ''* + {}'') su *pohlepni operatori*, tako da proširuju podudaranje koliko god mogu kroz dati tekst.
  
-For example, ''<.+>''  matches ''<nowiki><div>simple div</div></nowiki>''  in ''This is a <nowiki><div>simple div</div></nowiki>'' test. In order to catch only the ''div''  tag we can use a ''?''  to make it lazy \\ +Na primer, ''<.+>'' odgovara ''<nowiki><div>simple div</div></nowiki>''  ''This is a <nowiki><div>simple div</div></nowiki>'' test. Da bismo uhvatili samo oznaku ''div'', možemo koristiti ''?'' da je učinimo lenjim \\ 
-''<.+?>'' matches any character **one or more** times included inside ''<'' and ''>'', **expanding as needed**. \\+''<.+?>'' podudara se sa bilo kojim znakom **jedan ili više** puta uključenim unutar ''<'' ''>'', **proširujući po potrebi**. \\
  
-Notice that a better solution should avoid the usage of ''.''  in favor of a more strict regex+Primetite da bi bolje rešenje trebalo da izbegava upotrebu ''.'' u korist strožijeg redovnog izraza
-''<[^<>]+>'' matches any character except ''<'' or ''>'' one or more times included inside ''<''  and ''>''.+''<[^<>]+>'' odgovara bilo kom znaku osim ''<'' ili ''>'' jednom ili više puta uključenim unutar ''<'' ''>''.
  
 ---- ----
  • kb/zapisi/regex_main.txt
  • Last modified: 2023/08/16 09:11
  • by milano