473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Have any idea about regular expression ?

Mo
Have any idea about regular expression ?

I posted this question to other newsgroup, but I'm still hungry for it.

I tried to change any numeric characters to Zero like following;
$aaa = ereg_replace ("|0-9|", "0", $sentence);
This seems working perfect.

My question is how I can do this function only for outside of html tags.
I don't want any numeric characters to be changed inside html tags.

Thanks for further response.

Regards,
Mo
Jul 17 '05 #1
2 1791
"Mo" <mo@naggama.co.kr> schrieb:
Have any idea about regular expression ?

I posted this question to other newsgroup, but I'm still hungry for it.

I tried to change any numeric characters to Zero like following;
$aaa = ereg_replace ("|0-9|", "0", $sentence);
This seems working perfect.

My question is how I can do this function only for outside of html tags.
I don't want any numeric characters to be changed inside html tags.


Give it a try - I didn't try it myself. :-)

| $aaa = preg_replace("/((<[^>]*)|\d)/e", '"\2"=="\1"? "\1":"0"', $sentence);

Regards,
Matthias
Jul 17 '05 #2
Thanks Matthias

It works perfect.
$aaa = preg_replace("/((<[^>]*)|\d)/e", '"\2"=="\1"? "\1":"0"', $sentence);

Thanks again

Regards,
Mo

"Matthias Esken" <mu******************@usenetverwaltung.org> wrote in
message news:bl**********@usenet.esken.de...
"Mo" <mo@naggama.co.kr> schrieb:
Have any idea about regular expression ?

I posted this question to other newsgroup, but I'm still hungry for it.

I tried to change any numeric characters to Zero like following;
$aaa = ereg_replace ("|0-9|", "0", $sentence);
This seems working perfect.

My question is how I can do this function only for outside of html tags.
I don't want any numeric characters to be changed inside html tags.
Give it a try - I didn't try it myself. :-)

| $aaa = preg_replace("/((<[^>]*)|\d)/e", '"\2"=="\1"? "\1":"0"',

$sentence);
Regards,
Matthias

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bryce Budd | last post by:
Hi all, I am trying to use a regular expression validator to check for the existence of PO Box in an address textbox. The business rule is "No addresses with PO Boxes are allowed." What I...
11
by: Martin Robins | last post by:
I am trying to parse a string that is similar in form to an OLEDB connection string using regular expressions; in principle it is working, but certain character combinations in the string being...
9
by: MJ | last post by:
HI I want to know what is mean by regular expression in C Mayur
4
by: Buddy | last post by:
Can someone please show me how to create a regular expression to do the following My text is set to MyColumn{1, 100} Test I want a regular expression that sets the text to the following...
10
by: Lee Kuhn | last post by:
I am trying the create a regular expression that will essentially match characters in the middle of a fixed-length string. The string may be any characters, but will always be the same length. In...
4
by: rufus | last post by:
I need to parse some HTML and add links to some keywords (up to 1000) defined in a DB table. What I need to do is search for these keywords and if they are not already a link, and they are not...
9
by: Pete Davis | last post by:
I'm using regular expressions to extract some data and some links from some web pages. I download the page and then I want to get a list of certain links. For building regular expressions, I use...
8
by: Mohammad Omer | last post by:
Hi, i want to use regular expression in my project for validation of email. How i can use Regular Expression in VC?? i am using vs2k5 IDE. i seen boost api for regular expression, is it any...
8
by: Uwe Schmitt | last post by:
Hi, Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ? Are there any plans to speed up Pythons regular expression module ? Or is the example in this artricle too...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.