I have been programming a word-unscrambler. I need to parse the information between a group of tags and another, and put all matches into an array. The beginning tag is:
<tr> <td></td><td><li>
and the ending tag is:
</li></td> </tr>
I know some regular expressions, but I am unfamiliar with PHP.
...
The task is to find if the string starts with http:// or https:// or ftp://
$regex = "((https?|ftp)\:\/\/)?";
but preg_match($regex) does not work correctly. What should I change?
...
I need to do a simple regex find and replace with PHP for my syntax highlighting script in PHP.
I need to take a string of code which will actually be a whole php file that is read into a string like this.
$code_string = 'the whole source code of a php file will be held in this string';
And then find all occurences of these and d...
Hello, i have been working on one tool lately. It grabs all the link addresses from the website.
My problem is that links in html code sometimes is different:
/index.php
index.php
http://www.website.com/index.php
I need to make all links same:
/index.php -> http://www.website.com/index.php
index.php ...
I have situation where in the regular expression is something like this:
^b?A+b?$
So b may match at the start of the string 0 or 1 times, and A must match one or more times. Again b may match at the end of the string 0 or 1 times.
Now I want to modify this regular expression in such way that it may match b either at the start or at the...
On a single line Regex if I want to capture all till the end of line.. Which of these will be better in terms of Performance?
Regex r = new Regex(".+");
OR
Regex r = new Regex("[^$]+$");
I haven't included the entire regex but I hope you get the idea.
Are there any trade-offs or they both behave the same way?
Thanks!
...
I want to validate the e-mail address entered by the user that it is like that format [email protected]. iti.gov.eg must be writen in the e-mail address. The user must enter his e-mail address in that format in text box.
And how can I retrive it from the text box and check it?
My code is:
var r=/^([a-z\.])+\@(iti)+\.+(gov)+\.+(eg)+$...
Hey guys!
I've just began learning Python and I've ran into a small problem.
I need to parse a text file, more specifically an HTML file (but it's syntax is so weird - divs after divs after divs, the result of a Google's 'View as HTML' for a certain PDF i can't seem to extract the text because it has a messy table done in m$ word).
Any...
Hi to all,
My application creates a SharePoint site and an Active Directory group from user input. Special characters that are mentioned in http://www.webmonkey.com/reference/Special_Characters becomes a big problem in my application. Application creates group names differently and application can't access them from name property. I wan...
I have a need to search all numbers with 4 digits between 2000 and 3000.
It can be that letters are before and after.
I thought I can use [2000-3000]{4}, but doesnt work, why?
thank you.
...
I get the XML from a web service in the format below and I want to clean it up (remove the extra "\" and "\n" characters) before working with it. I am currently using the regular expression below to match. However only the "\n" characters are cleaned up, while the "\" characters which are in between equal and double quotation marks persi...
Hi, Could somebody help me parse following from the C# method declaration: scope, isStatic, name, return type and list of the parameters and their types. So given method declaration like this
public static SomeReturnType GetSomething(string param1, int param2)
etc. I need to be able to parse it and get the info above. So in this case
...
Possible Duplicates:
Random Text generator based on regex
Using Regex to generate Strings rather than match them
Hi,
I need a matches generator for my regular expressions.
E.g. for input like:
[A-Z]+[0-9]?
I get output:
FDLJUIOAF
LFDSJKHI8
B
IJKL5
And so on. I need this to show client what commands are currently suppo...
Is it possible to do something like this with regular expressions: encode and decode a number?
For example I want to encode the id 15123 (which actually represents a port number in my case) into something which is useless to a user, for example a seemingly random string such as c95Dd7!7. And then decode it afterwards.
I want to do this...
I have a string which may hold special characters like: $, (, @, #, etc.
I need to be able to perform regular expressions on that string.
Right now if my string has any of these characters the regex seems to break since these are reserved characters for regex.
Does anybody knows a good subroutine that would escape nicely any of these c...
Greetings JavaScript and regular expression gurus,
I want to return all matches in an input string that are 6-digit hexadecimal numbers with any amount of white space in between. For example, "333333 e1e1e1 f4f435" should return an array:
array[0] = 333333
array[1] = e1e1e1
array[2] = f4f435
Here is what I have, but it isn't qui...
What's the best way to look for a pattern in a (potentially) very large text.
I could use Regex but it accepts a string as an argument. Is there a way to use it with a TextReader or some kind of stream instead?
...
I am trying to break down the following string:
"@command Text1 @command2 Text2"
in Ruby. I want to take out "Text1" and "Text2" in an array. To do this I am using the scan method and using this:
text.scan(/@* (.*?)(@|$)/)
However, when run, the script is pulling the @ symbol in the middle as a separate match (presumably because th...
I'm trying to do a simple regex split in Python. The string is in the form of FooX where Foo is some string and X is an arbitrary integer. I have a feeling this should be really simple, but I can't quite get it to work.
On that note, can anyone recommend some good Regex reading materials?
...
I have a string that contains dynamic HTML content.
I want to be able to find and replace all occurrances of specific HTML tags and replace them, but not the content within them.
The specific HTML tags would be for a table - i.e. TABLE, TR, and TD. The tags may contain attributes, or they may not. How would one go about doing this in...