-5

I would like to extract some strings from between quotes using regular expression. The text is shown below:

CCKeyUpDomReady('test.asmx/asdasd', 'QMlPJZTOH09XOPCcbB2jcg==', '0OO6h+G2Tzhr5XWj1Upg0A==', '0OO6h+G2Tzhr5XWj1Upg0A==', '/qqwweq2.asmx/qqq')

Expected result must be:

test.asmx/asdasd
/qqwweq2.asmx/qqq

How can I do it? Here is the platform for testing: https://regexr.com/3n142

The criteria: string which is between quotes must contains "asmx" word. The text is much more than showed above. You can think like that you are searching asmx urls in a website source code.

PhoneixS
  • 10,574
  • 6
  • 57
  • 73
Ceylan B.
  • 564
  • 9
  • 23

1 Answers1

3

See regex in use here

'((?:[^'\\]|\\.)*asmx(?:[^'\\]|\\.)*)'
  • ' Match this literally
  • ((?:[^'\\]|\\.)*asmx(?:[^'\\]|\\.)*) Capture the following into capture group 1
  • ' Match this literally

The result is in capture group:

test.asmx/asdasd
/qqwweq2.asmx/qqq
ctwheels
  • 21,901
  • 9
  • 42
  • 77