PHP过滤代码,正则表达式过滤掉调用种的方法
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次或多次
\( 匹配括号

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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

Oneofthecontestsheldby1839Awardsin2024wasspecialinthatsubmissionstoitweretobegeneratedbyartificialintelligenceratherthancreatedwithacamera.ItwasthiscontestthatpiquedthecuriosityofacertainMilesAstray.Insteadofus

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 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

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.

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

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.
