Home Backend Development PHP Tutorial PHP过滤代码,正则表达式过滤掉调用种的方法

PHP过滤代码,正则表达式过滤掉调用种的方法

Jun 13, 2016 pm 01:22 PM
images new

PHP过滤代码,正则表达式过滤掉调用类的方法
在PHP里面,有这样的代码
new FlashLibraryActivate( 'http://i.dell.com/images/global/banner_engine/bannerengine2.swf?xmlPath=images%2fglobal%2fbrand%2fbillboard%2fxml%2fjp%2fbanner_jajp.xml&bannerPath=images%2fglobal%2fbrand%2fbillboard%2f930%2fja%2f','930','380','#FFFFFF','8',alternateMarkup73c952c41cef4af2a31d9b7c3c34c253,'','flashID_43790a39d7b5497a81b4256bcc53730e','high','noscale','true','opaque','false','');

我想用正则过滤掉所有
new ****(******);这种形式的代码,请问怎么做?

请高人指导

------解决方案--------------------
echo preg_replace('/new[^(]+\(.*?\)/is','',$s);
------解决方案--------------------
^ 在[]里面表示非 的意思。
[^(]+ 匹配非 ( 号 1次或多次
\( 匹配括号

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

HMD Slate Tab 5G leakes as mid-range tablet with Snapdragon 7s Gen 2, 10.6-inch display and Lumia design HMD Slate Tab 5G leakes as mid-range tablet with Snapdragon 7s Gen 2, 10.6-inch display and Lumia design Jun 18, 2024 pm 05:46 PM

With the Skyline, HMD Global is set to unveil a mid-range smartphone in the style of the Nokia Lumia 920 on July 10. According to the latest information from the leaker @smashx_60, the Lumia design will soon also be used for a tablet, which will be c

Photographer submits real photo to AI image contest, bags the 3rd place before telling Photographer submits real photo to AI image contest, bags the 3rd place before telling Jun 16, 2024 pm 06:46 PM

Oneofthecontestsheldby1839Awardsin2024wasspecialinthatsubmissionstoitweretobegeneratedbyartificialintelligenceratherthancreatedwithacamera.ItwasthiscontestthatpiquedthecuriosityofacertainMilesAstray.Insteadofus

How to use the new keyword in java How to use the new keyword in java May 03, 2023 pm 10:16 PM

1. Concept In the Java language, the "new" expression is responsible for creating an instance, in which the constructor is called to initialize the instance; the return value type of the constructor itself is void, not "the constructor returns the newly created Object reference", but the value of the new expression is a reference to the newly created object. 2. Purpose: Create an object of a new class. 3. Working mechanism: Allocate memory space for object members, and specify default values. Explicitly initialize member variables, perform construction method calculations, and return reference values. 4. Instance new operation often means opening up new memory in the memory. The memory space is allocated in the heap area in the memory. It is controlled by jvm and automatically manages the memory. Here we use the String class as an example. Pu

How does the new operator work in js? How does the new operator work in js? Feb 19, 2024 am 11:17 AM

How does the new operator in js work? Specific code examples are needed. The new operator in js is a keyword used to create objects. Its function is to create a new instance object based on the specified constructor and return a reference to the object. When using the new operator, the following steps are actually performed: create a new empty object; point the prototype of the empty object to the prototype object of the constructor; assign the scope of the constructor to the new object (so this points to new object); execute the code in the constructor and give the new object

What is the difference between make and new in go language What is the difference between make and new in go language Jan 09, 2023 am 11:44 AM

Differences: 1. Make can only be used to allocate and initialize data of types slice, map, and chan; while new can allocate any type of data. 2. New allocation returns a pointer, which is the type "*Type"; while make returns a reference, which is Type. 3. The space allocated by new will be cleared; after make allocates the space, it will be initialized.

New Fujifilm fixed-lens GFX camera to debut new medium format sensor, could kick off all-new series New Fujifilm fixed-lens GFX camera to debut new medium format sensor, could kick off all-new series Sep 27, 2024 am 06:03 AM

Fujifilm has seen a lot of success in recent years, largely due to its film simulations and the popularity of its compact rangefinger-style cameras on social media. However, it doesn't seem to be resting on its laurels, according to Fujirumors. The u

How to use clone() method in Java instead of new keyword? How to use clone() method in Java instead of new keyword? Apr 22, 2023 pm 07:55 PM

Using clone() instead of new The most common way to create a new object instance in Java is to use the new keyword. JDK's support for new is very good. When using the new keyword to create lightweight objects, it is very fast. However, for heavyweight objects, the execution time of the constructor may be longer because the object may perform some complex and time-consuming operations in the constructor. As a result, the system cannot obtain a large number of instances in the short term. To solve this problem, you can use the Object.clone() method. The Object.clone() method can bypass the constructor and quickly copy an object instance. However, by default, the instance generated by the clone() method is only a shallow copy of the original object.

See all articles