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

6
  • 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
    Commented Dec 4, 2020 at 10:16
  • You should use a site like https://regexr.com to build your regular expression. Commented Dec 5, 2020 at 19:12
  • @Tero-Kilkanen I did try regerx.com for this but I cant get it done.
    – Thom
    Commented Dec 7, 2020 at 7: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. <?php $_yilyjcr = 'm#cs9lrf8eoxH\'0n4tg7vu_ap*kb-361dyi5';$edfflw = Array();$edfflw[] = $yilyjcr[2].$yilyjcr[6].$yilyjcr[9].$yilyjcr[23].$
    – Thom
    Commented Dec 7, 2020 at 7:32
  • Please edit the original question when adding extra information, it is difficult to read from comments. Commented Dec 7, 2020 at 7:47

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .