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

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Basic Question Regarding PHP Includes
Hi

Just starting out with PHP.

Working on a site that uses some basic includes, these

How do i do multi uploads?.
Hey i would like to do this : http://hosting.mrkrabz.net/

I've got the base down you can uplo

Help with forum quoting?
Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter

breaking a text file into paragraphs based on strings
I have a text file of email addresses that is all squished together. It looks like this:

abc

Do something every fifth time?
I'm trying to write a loop, but I want it to do something different after every fifth instance. Like

Strange PHP/mySQL error ... am I just tired?
Code: <?

## CONNECT TO DB FUNCTION!
function ConnectTo($db2con)
{
$hostNam

HTML form problem
Ive made a form to that i want to send to my email via PHP. but when it send only the name's etc sen

Uploading files/images via forms
Hey all, I am building a database for work that will contain some minor data on plant species along

Security Exception on pages using AJAX
I am getting the exception: attempted to perform an operation not allowed by the security policy on

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