I'm dealing with a scrupt that for some reason can't read normal $_GET and $_POST and just reads the whole thing as a string. This is the string it reads and I'm given this as output.
?field1=value1&field2=value2&field3=value3
I'm writing a function that works with this output to break it up into its individual field1, field2, field3 ...
I have a small templating system in javascrip, where the user can put tags in the form $tagname$. I can match all tags with the patter: /\$\w+\$/.
Also, I want to match incomplete tags specifically (it would start with $ and finish with a word boundary that is not $). I can't use /\$\w+\b/ because $ is also a word boundary (so it will a...
This is my second attempt to get this answer since I messed it up first time :s As you can guess Im new to regex
basically, the string contains lots of words seperated by "\"'s. so for example
\gyifgy8i\gyigyi9g\player_0\k1ng*tar%\gp86gg78.\g79g\player_1\th3dadY>\gyigyigiy\huiohgiu\player_2\j0k$r\g68g6o9g\987pgh890\player_3\PLAYERNAME
...
I have a need to verify a specific hyperlink exists on a given web page. I know how to download the source HTML. What I need help with is figuring out if a "target" url exists as a hyperlink in the "source" web page.
Here is a little console program to demonstrate the problem:
public static void Main()
{
var sourceUrl = "http://dev...
I have a string that looks like "A=1.23;B=2.345;C=3.567"
I am only interested in "C=3.567"
what i have so far is:
Matcher m = Pattern.compile("C=\\d+.\\d+").matcher("A=1.23;B=2.345;C=3.567");
while(m.find()){
double d = Double.parseDouble(m.group());
System.out.println(d);
}
the problem is it shows the...
What's the maximum size of a regular expression in modern browsers (i.e. Firefox 3+, Safari 4+, IE 7+)? Assume a simple regular expression, of, say "foo|bar|baz|woot|..."
...
What is the simplest way to reverse the case of all alphabetic characters in a C# string? For example "aBc1$;" should become "AbC1$;" I could easily write a method that does this, but I am hoping there is a library call that I don't know about that would make this easier. I would also like to avoid having a list of all known alphabetic c...
EDIT: Two additional token types added.
Hi,
I am trying to parse a line in a mmCIF Protein file into separate tokens using Excel 2000/2003. Worst case it COULD look something like this:
token1 token2 "token's 1a',1b'" 'token4"5"' 12 23.2 ? . 'token' tok'en to"ken
Which should become the following tokens:
token1
token2
token's 1a',1b'...
I am attempting to use a regular expression with Scanner to match a string from a file. The regex works with all of the contents of the file except for this line:
DNA="ITTTAITATIATYAAAYIYI[....]ITYTYITTIYAIAIYIT"
in the actual file, the ellipsis represents several thousand more characters.
When the loop that reads the file arrives on...
I don't know if this is possible using regex. I'm just asking in case someone knows the answer.
I have a string ="hellohowareyou??". I need to split it like this
[h, el, loh, owar, eyou?, ?].
The splitting is done such that the first string will have length 1, second length 2 and so on. The last string will have the remaining charact...
I have a String with multiline content and want to select a multiline region, preferably using a regular expression (just because I'm trying to understand Java RegEx at the moment).
Consider the input like:
Line 1
abc START def
Line 2
Line 3
gh END jklm
Line 4
Assuming START and END are unique and the start/end markers for the region...
I need to write a regular expression for the following (NB. ignore carriage returns, I've added them for readability):
<strong>Contact details</strong>
<p><label>Office:</label> +44 (0)12 3456 7890<br />
<label>Direct:</label> +44 (0)12 3456 7890<br />
<label>Mobile:</label> +44 (0)1234 567890<br />
<label>E-mail:</label>...
Can somebody show me some examples to import a html-page and
use the XPath to find the keywords including the rest of the text from the div, p, title etc.
Thank you!
EDIT:
In this case i use my webcrawler for example, i have a form to get the website to be crawled and the keywords wich has to be find in pages of the website.
http://c...
I was assigned a problem to find genes when given a string of the letters A,C,G, or T all in a row, like ATGCTCTCTTGATTTTTTTATGTGTAGCCATGCACACACACACATAAGA. A gene is started with ATG, and ends with either TAA, TAG, or TGA (the gene excludes both endpoints). The gene consists of triplets of letters, so its length is a multiple of three, a...
I want to extract all words enclosed in curly braces, so I have an expressions like this
foo {bar} moo {mar}
The string to match may have any number of these words, but I'm starting to think I'm approaching this problem in the wrong way.
My attempt
And I've tried to extract the words braces into groups so I can use every single matc...
Hay, i have a system basically tracks finances. In this application it has a "cost" field (which unfortunately is VARCHAR field). This field has various values entered like:
£90
£210 per day
£50 per logo
Design - £180
£36 p/h
£1009.51
Is there any way i can convert these to floats? I tried just using (float) to juggle the type into a ...
Hi.
Im about to create a registration form for my website. I need to check the variable, and accept it only if contains letter, number, _ or -.
How can do it with regex? I used to work with them with preg_replace(), but i think this is not the case. Also, i know that the "ereg" function is dead. Any solutions?
...
I'm still kind of new to RegEx in general. I'm trying to retrieve the names from a field so I can split them for further use (using Pentaho Data Integration/Kettle for the data extraction). Here's an example of the string I'm given:
CN=Name One/OU=Site/O=Domain;CN=Name Two/OU=Site/O=Domain;CN=Name Three/OU=Site/O=Domain
I would like...
Hello,
I've got a big XML file I'm editing with BBEdit.
Within the XML file, which is a digital recreation of an old diary, is text that is enclosed in note tags.
<note>Example of a note.</note>
Some note tags, however, have quotations enclosed in quote tags nested in them.
<note>Example of a note, but <quote>"here is a quotation w...
I want to enable my users to specify the allowed characters in a given string.
So... Regex's are great but too tough for my users.
my plan is to enable users to specify a list of allowed characters - for example
a-z|A-Z|0-9|,
i can transform this into a regex which does the matching as such:
[a-zA-Z0-9,]*
However i'm a little l...