0

This might have been asked before but I cant find a solution. I am looking for a simple "Regular Expressions" search pattern to find something in my PHP files.

I am looking for the following pattern

<?php
$_yilyjcr = '

However, the "_yilyjcr" can be different or longer or shorter. Sometimes have a symbol and sometimes not So the goal would be to search in EMEditor using a reguklar expression that looks for

<?php
$_yilyjcr = 'm#cs9lrf8eoxH\'0n4tg7vu_ap*kb-361dyi5';$edfflw = Array();$edfflw[] = $yilyjcr[2].$yilyjcr[6].$yilyjcr[9].$yilyjcr[23].$

Would anyone maybe have a tip for me what search pattern I could use to find files that contain this? I would be really appriciate any assistance.

Best wishes, Thomas

Thom
  • 31
  • 1
  • 3
  • I'm no expert in regex but I came out with this that matches the pattern that you've provided `^\<\?php\n^\$[a-zA-Z0-9]*\s=.*$` I'm sure someone will find a more efficient way of doing this. – BANJOSA Dec 04 '20 at 10:16
  • You should use a site like `https://regexr.com` to build your regular expression. – Tero Kilkanen Dec 05 '20 at 19:12
  • @Tero-Kilkanen I did try regerx.com for this but I cant get it done. – Thom Dec 07 '20 at 07:32
  • @BANJOSA thank you for this but it does not work. I tryed this in regexr.com using the code below as sample. but it fdoes not find it. ` – Thom Dec 07 '20 at 07:32
  • Please edit the original question when adding extra information, it is difficult to read from comments. – Tero Kilkanen Dec 07 '20 at 07:47
  • @Thom of course it doesn't work, that was not the sample you've provided in the question. in you question. that regex was tailored to capture what you've provided as an example. Please had a real example to your question. – BANJOSA Dec 07 '20 at 09:37

1 Answers1

0

Thank you for the help, you both have broght me on the right track. I have edited the original question. However, I have figured it out.

I did use:

\<\?.{3}\n\$.{5,8}\s\=\s.{30,50}\;\$[a-zA-Z0-9]{5,8}\s\=\s[a-zA-Z0-9]{5}\(\)

that found all instances for this.

Thom
  • 31
  • 1
  • 3