SRL-PHP icon indicating copy to clipboard operation
SRL-PHP copied to clipboard

Can't do this ((data-id)="|src=") ?

Open syrm opened this issue 7 years ago • 2 comments

I am wrong or i can't do this regex : ((data-id)="|src=") I tried lots of thing, my last attempt is this one :

capture ( any of ( ( capture(literally 'data-id'), literally '="' ), (literally 'src="') ) )

The SRL Query contains an error: Non-matching parenthesis found.

syrm avatar Mar 14 '17 13:03 syrm

Hi,

thanks for your comment. Yes, it seems like this indeed doesn't work, as it will treat any of the statements in the "any of" group equally and gets confused by the parenthesis around the inner two conditions.

The closest I can get is

capture (
  any of (
    capture(literally 'data-id'), literally '="',
    literally 'src="'
  )
)

which of course isn't right. Maybe working with quantifiers helps to find a way around, but this shouldn't be the case. I'll have a look at it.

KarimGeiger avatar Mar 14 '17 14:03 KarimGeiger

I tried to find a solution with quantifier, but can't found a solution either.

syrm avatar Mar 14 '17 14:03 syrm