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

preg_replace failing on new line, unsure best way to fix

1
My first post/question here so I hope the title was specific enough for this issue. Did a search but didn't find what I was looking for.

The problem: When using preg_replace to replace items it works unless there is a new line right after the items.

IE: !username
!username (without spaces)

This is what I have:
$text = preg_replace('/[!]+('.$value.'+)/',$profileLink,$text);

It works when there IS a space though.

Is there a way to fix it IN the preg_replace or should I replace new lines with new lines with a space wrapped around them?
Jun 18 '12 #1
0 1136

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Simon Stewart | last post by:
Has anyone else experience of imagecreatefromjpeg failing with an error message about memory even though the size of the image being uploaded is nothing like the space available to the script? ...
0
by: Nak | last post by:
Hi there, I have come across a rather frustrating bug with the 2002 VB.NET Standard IDE. I am currently developing an application framework to use my my new products, all is pretty straight...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
3
by: Furty | last post by:
Hi, I'm looking for the best practice for creating a generic data validation implementation for my data bound business objects. I currently have a business object base class implementing the...
2
by: Steve Le Monnier | last post by:
Can anybody give me a quick heads up on the best way to develop C# based DLL's that are called via VBA. I'm developing a pop-up window that will record information within SQL. I need to launch...
8
by: bcdonovan | last post by:
Hi everyone, I'm wondering if anyone knows of a way to extract data from a numeric array along a line. I have a gridded dataset which I would like to be able to choose two points and extract a...
3
by: Boki | last post by:
Hi All, We can assign multi object ( ex: textbox )'s double click point to a same function. ex: private void all_boki_textbox_point_here_DoubleClick(object sender, EventArgs e) { ...
3
by: ellisrj | last post by:
Hi guys, I'm trying to find the slope of a trend line that best fits a bunch of X and Y points, as per this thread: http://www.thescripts.com/forum/thread472629.html The difference being that I...
2
by: sprouds | last post by:
CAn anyone help me out i am trying to work out the line of best fit within visual studios c++ how do i go about writing a program to do this
2
FLEB
by: FLEB | last post by:
Is there a built-in function or a simplified method to tell where a given line of text wraps/will wrap in a given container (the container is fixed-width)? I want to chop off and add an ellipsis to...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.