regex for quoted text within a string


Posted on 16th Feb 2014 07:03 pm by admin

I am still getting the hang of regex expressions, but I cant seem to figure out how I would escape quoted text within a string. The qualitifcations for escaping them would be to have [a space] [a double quote] [any text] [a double quote] [a space] but there cant be anything besides a space before and after, not even a newline.

here's what i have so far:

Code: $pattern = '/ "." /';
$replacement = '/ "." /';
$val = preg_replace($pattern, $replacement, $val);
But it's not working. I've always wanted to learn how to use regular expressions and like I said I am new to them.

No comments posted yet

Your Answer:

Login to answer
72 Like 32 Dislike
Previous forums Next forums
Other forums

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas

PEAR Email Attachment w/ $gpg
I have no issues with this code if I take out the attachement section and include the info in the em

links using header()
Hi All

I'm not sure where to ask for help on this but I hope someone can offer some. I'm at

Am I setting up my sites oldschool?
Ok,

When I create a site I open a basic template that I have created that consists of a css f

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

losing session vars when arriving from an email link
Hi,

I've got a confirmation script made that sends an email with a link for a user to confirm

$_GET problem
Hi all,

Have a bit of a problem with a little piece of code, I am not sure if this should be

Word Trimming
Hi Guys & Gals!!

Hope you are all ok....

I need some help with the following

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash