0
votes
3answers
19 views

preg_match to select outside string

$newpair = '~I love~~you~ notes'; preg_match_all ('^\~(.*?)\~^' , $newpair, $np); foreach($np[1] as $key ){ print_r($np[1]); echo $key .'<br/>'; } echo $np; //result: I love you Above ...
0
votes
3answers
30 views

very simple preg_replace doesnt work

I have this code, is working in all the tester I'm using for regex, but later, in my real php code it doesn't work. What I want is to replace the number in the link for something else ...
1
vote
3answers
36 views

regex to match entire words containing (one or more) mandatory and allowed characters

I want to match entire words that containing at least one of mandatory chars and allowed chars. For example Mandatory chars are : [ t , a , x ] Allowed chars are : [ i , e] t : passed (one of ...
0
votes
2answers
55 views

How to use preg_match to match everything except numbers in PHP?

Here is my code: //Validate names have correct characters if (preg_match("/^[a-zA-Z\s-]+$/i", $_POST['first']) == 0) { echo '<p class="error">Your first name must only include letters, ...
2
votes
2answers
32 views

PHP see how many characters are equal

I have a string full of values that are separated by a comma. Needless to say this can be done with $strings = explode(',',$fullstring);. Now, I need to compare a user-submitted-value to this value ...
1
vote
1answer
18 views

removal of a date in the text using regex or alternative small scripts

$string="18 Mar 2013 <b>...</b> And this is exactly what is sparking the resurgence of long-tail <br> <b>keyword</b> targeting in <b>SEO</b>. I've observed ...
0
votes
1answer
14 views

filter a key/value (specially APC) data store items

When i start working with APC, I expected that there is a way to make categories for cached items not only key/value pairs. because i want to clear cache only for one application or only one part my ...
1
vote
2answers
30 views

preg_replace json string match same character beginning/end

Ok so what I have is a JSON string which can contain 1 or many elements below I've put an example of the sting but this is only an example the real string is much more complicated. This one ...
4
votes
4answers
48 views

Regular expression to match key-value pairs where value is in quotes or apostrophes

I'm trying to complete a PHP app in the next 2 weeks and I just can't figure out the regular expression to parse some attribute strings. I get random strings that are in the format of like this ...
-4
votes
0answers
48 views

Please help . My diploma thesis project [closed]

How can i take synonyms which composed/consist of one word here it's rugby and soccer. Necessarily through regexp!!Please i can't finished my diploma thesis((( I must find mathces dynamically.Cause i ...
-4
votes
0answers
49 views

RegExp/PHP.How solve this task? [closed]

How can i take synonyms which composed/consist of one word here it's rugby and soccer. Necessarily through regexp!! Synonyms: American football, Association football, Canadian football, grid game, ...
-5
votes
1answer
49 views

Regular expression. Simple task [closed]

How to match words rugby and soccer?? With help of regexp Synonyms: American football, Association football, Canadian football, grid game, gridiron pastime, rugby, soccer, the pigskin sport
2
votes
2answers
36 views

PHP - preg_match/preg_replace problems

I'm a little confused with preg_match and preg_replace. I have a very long content string (from a blog), and I want to find, separate and replace all [caption] tags. Possible tags can be: ...
1
vote
1answer
16 views

Algorithm to distinguish US TIN between SSN and EIN

Tax payers in the Unites States must have a tax identification number of some kind. It must either be a Social Security Number, or Individual Taxpayer Identification Number (for aliens, so that they ...
0
votes
1answer
14 views

$matches[0] not displaying data on screen but says it is there?

$str = "<p><example:wow id='test' style='hello' /></p>"; preg_match_all ("/<example:wow(.*)[^>]>/", $str, $matches); My $matches[0] says there is data there (string ...

1 2 3 4 5 748
15 30 50 per page