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:

Did you know?Explore Trending and Topic pages for more stories like this.
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

PHP Blog help
Need help with posting comments in a word press blog? I have a comments page where the comments are

problem with refreshing
in my site, i have an index page, it has a main div. this main div's content is changing according t

radio button reamains checked
Hello i'm trying to keep the state off my radio buttons so it shows which ones where clicked after t

preg_match logical error
Code: <?php
$s = file_get_contents("page.html");
preg_match('/<div cla

having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. F

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

Find current logon time
Hi,
in my sql script i want to query and find out the logon time of the current session.
<

getting Vars to pass to next page.
Hello all,
I have a confusing situation on my hands, i am a member of a gaming community and we

reading xml faster than DB call?
I am trying to optimize a high traffic website, and I enabled a feature where there are three photos

Trouble checking SESSION cookie
I am trying to use $_SESSION cookies to verify admin privileges .
I don't understand why this is

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