1

If line contains a word then return text between characters "

<a href="index.php?sheet=2362327&sign=1" alt='This is funny alt' class='some test classes'>

I need to get url index.php?sheet=2362327&sign=1 if sign= is found.

P.S

I have found a way to get a line if word is found: /^.*\bsign=\b.*$/m

And to get content between 2 characters: (?<=")(.*)(?=")

IvRRimUm
  • 1,724
  • 3
  • 21
  • 40

1 Answers1

1
(?<=")[^"]*\bsign=\b[^"]*(?=")

You can just club the two to get your result.

vks
  • 67,027
  • 10
  • 91
  • 124
  • 1
    This did the work, I think i will read a book about regex, thats my weak spot at the time ;// 5 minutes till i can accept your answer! – IvRRimUm Apr 05 '15 at 19:44