Einzelnen Beitrag anzeigen

Benutzerbild von Meflin
Meflin

Registriert seit: 21. Aug 2003
4.856 Beiträge
 
#10

Re: Regex: alle html links eines String bekommen?

  Alt 18. Feb 2009, 19:40
Hier die Erklärung zur letzten RegEx (mit der für dich richtigen Klammerung):
Code:
<a.*?href=['"](.*?[^"]+)['"].*?>.*?</a>

Match the characters “<a” literally «<a»
Match any single character that is not a line break character «.*?»
   Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Match the characters “href=” literally «href=»
Match a single character present in the list “'"” «['"]»
Match the regular expression below and capture its match into backreference number 1 «(.*?[^"]+)»
   Match any single character that is not a line break character «.*?»
      Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
   Match any character that is NOT a “"” «[^"]+»
      Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
Match a single character present in the list “'"” «['"]»
Match any single character that is not a line break character «.*?»
   Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Match the character “>” literally «>»
Match any single character that is not a line break character «.*?»
   Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Match the characters “</a>” literally «</a>»
  Mit Zitat antworten Zitat