Tagged Questions
0
votes
1answer
11 views
PHP Zend test dump need help understanding
How many elements does the $matches array contain after the following function call is
performed?
this('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=200[0-9])/', '21st March
2006', $matches);
A.
1
B.
2
C.
3
...
0
votes
3answers
38 views
Regular expression for url parameter substitution
I've done little with Regex, but I know this has to be simpler than I'm making it.
Given a URL that looks like this:
/p1/p2/{p3}/{p4}/.../{pn}
where {p3}, {p4} contain keys to an associate array.
...
-1
votes
1answer
34 views
Implementing a basic Twitter/Facebook @mention system
I'm trying to create a basic @mention system for a microblogging application that I am creating (it's a project for me to learn PDO).
I read a few other similar questions and threads,but I still ...
3
votes
1answer
21 views
What regular expression to use in preg_match() for this?
I'm not really familiar with regular expressions, and I would really need your help with this.
I'm parsing a source code of a site, and the information I'm interested (lets call it XXXX) is ...
0
votes
1answer
26 views
Error with php regular expression
i have this code:
$text = "###12###hello###43###good###113###thefinalstring";
preg_match_all('/(.*?)###(\d*)###(.*?)/is', $text, $matches, PREG_SET_ORDER);
If I dump $matches, why there is not ...
1
vote
2answers
28 views
php curl select box values
I'm trying to get the values (preg_match) of an select list from one website.
HTML on website:
<select name="country_id" id="country_id">
<option value="vi">Vietnam</option>
...
1
vote
1answer
15 views
Searching by regex (total commander / php)
i'm using total commander (filemanager) which allows searching file content by regular expressions.
i'd like to search php files for deprecated syntax like $_SESSION[user] - so i need the regex for ...
2
votes
1answer
29 views
Replacing Heading (<h1>, <h2> …) Tags with <p> Tags and Classes
I wish to replace tags from a WYSIWYG editor to .
At the moment I am using the following code to achieve this.
$content = preg_replace('/<h1(.*?)<\/h1>/si', '<p ...
0
votes
6answers
38 views
PHP get specific string from url before and after unknown characters
I know it may sound as a common question but I have difficulty understanding this process.
So I have this string:
http://domain.com/campaign/tgadv?redirect
And I need to get only the word "tgadv". ...
2
votes
4answers
34 views
Combine two regular expressions into one, matching first and last part of URL?
How can I combine two regexes?
For example, I have this string:
/path/to/file/name.jpg
I want to match two parts of this string with only one regex, so that I can have "/path/to/file/" (everything ...
3
votes
2answers
73 views
Regular Expression - PHP
I am using following PHP code
<?
$data = file_get_contents('http://www.kitco.com/texten/texten.html');
...
5
votes
6answers
55 views
Regex - matching all between second set of brackets ([])
I have the following string that I need to match only the last seven digets between [] brackets. The string looks like this
[15211Z: 2012-09-12] ([5202900])
I only need to match 5202900 in the ...
1
vote
4answers
145 views
Get youtube id for all url types
The following code works with all YouTube domains except for youtu.be. An example would be: http://www.youtube.com/watch?v=ZedLgAF9aEg would turn into: ZedLgAF9aEg
My question is how would I be able ...
-4
votes
2answers
55 views
php regular expression to remove all commas and parentheses
What is the regular expression to remove commas and parentheses from a string?
0
votes
1answer
90 views
Can you please help modify this code to allow for Address and Zip Code Searches?
I am still struggling immensely with these sets of rules below.
Rule: Any search text of 6 or more characters will be interpreted as an ID if one of the following is true:
all characters are digits, ...