473,379 Members | 1,191 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,379 software developers and data experts.

preg_replace problem - please help

K.
Hello!

I would like to use preg_replace function to leave in the result variable
only:
1) letters from A to Z
including Polish letters like ±¶¼³óñê
including Polish upper letters like ¡¦¬£ÓÑÊ
2) letters []()-_=+!@#$%^&*`~',/\|.

I have for example such varaible

$text_test="M±¿ lubi czytaæ ksi±¿ki";

1) How to prevent from Russian letters? Does preg_replace help me to do so?

I have tried to do
preg_replace ("[^a-zA-Z0-9±¶¼³óñê-_\.]+",$xxxxx,$text_test)
but I think it is too poor.

2) what should I put in variable $xxxxx, because I don`t know what the
string is to replace for

Please help me
Marcin
Oct 19 '07 #1
1 1280
On 19 Oct, 08:35, "K." <halinaciern...@poczta.onet.plwrote:
2) what should I put in variable $xxxxx, because I don`t know what the
string is to replace for
It is up to you. If you want to remove all trace of them, use '' (the
empty string)

Oct 19 '07 #2

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

Similar topics

4
by: Sam | last post by:
Hi Can anyone help me with this problem please? I have a long string that I would like to split into paragraphed sentences. I would like to replace every full-stop or period ('.') with the...
4
by: Sidharta | last post by:
Hi all, how come this doesn't work????? # convert to unix new lines $text = preg_replace("/\r\n/", "\n", $text); # remove extra new lines $text = preg_replace("/\n+/", "\n", $text); is...
3
by: TXSherry | last post by:
Hi, I cannot seem to wrap my brain around preg_replace. Though I've read the help file backwords and forwards. :/ Hoping someone can give me a solution here. Problem: Given string 'str'...
7
by: Margaret MacDonald | last post by:
I've been going mad trying to figure out how to do this--it should be easy! Allow the user to enter '\_sometext\_', i.e., literal backslash, underscore, some text, literal backslash, underscore...
2
by: Fotozine | last post by:
well, I have this peace of code which isn't woking as I would like it to work. $tekst = preg_replace('/\\\"/', '&quot;', $tekst); In my forms, I would like to change " to &quot; but this line is actualy...
3
by: Charles | last post by:
I'm new to this regular expression stuff. I'd like to use preg_replace to eliminate a known multi-line signature from the body of an E-mail. Say the body text is in $body, and the sig is this ...
22
by: stoppal | last post by:
need to extract all text between the following strings, but not include the strings. "<!-- #BeginEditable "Title name" -->" "<p align="center">#### </p>" I am using preg_match(????, $s,...
1
by: Sbudah | last post by:
Hi All, I have relatively moderate experience with PHP but preg_replace is not one of my strong points. I need HELP with the following: I have 5 <div> tags whose values are sent to a PHP page...
5
by: helraizer1 | last post by:
Hey folks and folksesses, I have written some code to get emoticons onto my image based shoutbox but there is quite a large bug, as there is with any code in the early stages, and I need your help...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.