Regex for a PHP file

Hi!

I've been reading several questions from other people but I can't seem to figure out what I need.

Please I need help with a files. I have .php files, where I need to exclude certain texts.

Ex:
1- I need to not take me the text inside the comment.
Screenshot highlighting PHP code with words 'Trial' and 'Demo' within comments, indicated by a red box.

2- I don't need the code before those words. But I need this words: Trial, Demo, Contact
Close-up of PHP code with 'Trial', 'Demo', and 'Contact' text highlighted and enclosed in red boxes.

3- I need to exclude the code that is inside that tag (<?php ?>).
PHP tag containing code to be excluded, surrounded by a red box, with 'Our Customers' and 'Customer Acclaim' visible below.



Generated Image Alt-Text
[edited by: Trados AI at 2:48 AM (GMT 0) on 29 Feb 2024]
emoji
Parents Reply Children
  • Thank you Paul!

    I've been testing with the files and I see that using the default HTML5 filsetting is useful.

    It reads fine almost all the .php files I have, except for a few things. The problem is that as it is a filesetting already created, I don't know how to work with it.

    As you can see in the image, it takes that code inside the script tag.
    And on the other hand it takes "class" and "id" that I need to remove.

    Screenshot of Trados Studio showing the HTML5 filesetting interface with highlighted areas indicating issues with script tag code, and 'class' and 'id' tags that need removal.

    I attach the HTML5 filesetting and the file .php so you can see how to configure it to read the files, but I would be missing to remove those tags "class", "id" and the script code.

    Thanks for your help!

    5340.HTML5 filesetting and file.zip

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 2:48 AM (GMT 0) on 29 Feb 2024]