306 Topics
| |
Hi I have a task to do. I will just brief it in a sentence, I have a file of 20000 lines. Now task is to recognize number of similar lines. ex1 : "The quick brown fox jumps on a lazy dog" ex2 : "The quick brown dog jumps on … | |
Hello, I have a problem to this html code.I want to get only the data inside the href,but the data is dynamic. <a title="Click here to see docket information" href="/ccm/do/docket?county=65&data=eedd78d10fd9da341e05b25b48b62013">652012CC000006CCXXXX</a> I am not really familiar in regex.I am using this code to extract the html inside the href. MatchCollection m1 … | |
| I wanted to validate a string with preg_match but after a lot of struggle I just used if($str[0]!='x'.... but just out of curiosity I wonna know how to do this using preg_match I'm getting a string as an input- the 1st char in the string must be % the 2nd … |
Hi, I am working on Protein and DNA sequences. When you have a protein sequence it can be translated in to DNA sequence in many ways. A nice way to express this is using regular expression. I would like to create this long regular expression for a protein sequence, and … | |
do you know how can i put a hyphen (-) after 3 digits of a number(starting from the end) in php? example: the number 9787897878 to be shown as 978-789-7878?? | |
I have a problem in a payment solution I have made. In this, I use ereg to extract a returned Transaction ID from the payment provider, and with PHP 5.3 this does not work anymore. The code used was: ereg('<TransactionId>(.+)</TransactionId>',$resultat_3,$c); I have tried to use this instead: (but it doesn't … | |
I'm not very familiar with Javascript or Regex but I built a script that is working well with one small flaw in the Regex part. What I want to do is to find commas following alpa-numeric characters (actually almost anything other than a double quote) and then replace the comma … | |
Hi I am having trouble understanding how the pre_replace function works. I am using a script which has the following line: $ret = preg_replace("#(@|telefone|e-mail|.com|skype|.com.br|fone|www.|hotmail|yahoo|ig|aol|uol|gmail|bol|msn|MSN)#i", "\\1scriptolutionreplacement", $ret); What is happening is that any word with for example the letters ig or uol in it is getting caught. Is there a way … | |
Hi, I have text file which has lots of text as well as HTML data. There are some line as shown below. 06/30/12 00:40:30.73 Sending Email - Group: 4FD7917824F1B-EMAIL, 0, Message: There are lots of lines like above in text file. I want to extract following data from the entire … | |
| Hi all. Am having a senior moment here. I have a htaccess file thus: Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]*)/*([^/]*)/*([^/]*)/*([^/]*)/*([^/]*)/*$ index.php?lang=$1&top=$2&middle=$3&bottom=$4&sub=$5 [L] Which basically allows me to show http://www.mysite.com/cy/tgau/cemeg-1/ for http://www.mysite.com?lang=cy&top=tgau&middle=cemeg-1 That's all well and good. However, I'm getting real problems directing my forms to /includes/login.php This … |
Hey all, I usuallly don't like asking for help on these sites but I have been kicking myself for a while now implementing boost regex for a program (i have never had any prior issues). I believe the issue is with my regex syntax but i have tried numerous variations … | |
I cannot find the mistake in the following code function doArray(n){ // test with n > 1000 var str, i, j,arr=[], cnt=0, q=0, re; str = ["one two three","two three four","three four five", "four five one", "five one two"]; for(i=0; i<n; i++){ j = Math.round(Math.random()*(str.length-1)); arr.push(str[j]); } re =/two/g; for(i=0; … | |
I am using Awk inside a bash shell script to search header files for c++ functions so I can add these functions to another file. All of the functions I need will have form: type getName() or type setName(type value) Right now I get all the functions listed in between … | |
I am new to Regex... I need to split by "|&|" -- three characters in that exact order. For example, **"abc|&|e&f**" should return *"abc"* and *"e&f"*. I tried string.split("|&|") , but it return all single characters. | |
Suppose I need to have a regex expression (using Perl regex) that, say, matches a*b\q as simple text and does not interpret a* as any number of a's. I know it is simple here, but I need it to work for ANY string of characters. | |
Hi, I don't have any idea about regular expression. Can some on please suggest a good website for regular expression Tutorial. Also 1.Can some one please help me to generate a regular expression meeting all these requirements * A strings minmum length must be 3 charcters, and maximum length must … | |
| Morning, I'm attempting to perform a preg_match against a regular expression to identify whether it's a YouTube video or not. I've got, I'll admit, the regular expression from elsewhere... \s*(https?:\/\/www.youtube(?:-nocookie)?.com\/(?:v|embed)\/([a-zA-Z0-9-]+)).* This appears to work fine. However, I'm getting the following error when I attempt the preg_match... WARNING: [filename].php:[line] - preg_match() … |
Hello Friends... I need help on regular expressions.... I tried the following way but it did not work for me....please help me to create a regular expression... ^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(^[a-zA-Z0-9@\$=!:.#%]+$) My requirement is -> Min 8 to 15 characters - this I will do with the length validation or by including in … | |
Hello there, I'm a newbie in regex in c#, and I have a problem in parsing the html tag using regex in the <span> tag. here the html file that i want to get the value. <li><span>Date of birth</span>December 16, 2000 (Age: 12)</li> i want to get the December 16, … | |
What should be the regular expression for thid code ??? `<span style="text-align:justify;">Stepping out of the Shadows:M6 Once touched... Marisa Somerville has changed. Now a confi dent, groomed, successful businesswoman, in some ways she's nothing like the scared wife of an abusive husband that Rafe Peveril survived a plane crash with … | |
This has been frustrating me for about 20 minutes already and I don't want to spend much more time on it, so any help would be much appreciated. The editor that we use which syntax highlights Markdown text has has bug in which it highlights text as code when it … | |
Need help with code i am trying to acheive upload of videos but when they are uploaded the file names need to be changed to have hyphens in replace of white space and still keep the exstensions. its proving difficult because once uploaded ffmpeg needs to read the output as … | |
Hello there below is the easy way to get the email addresses extracted from any file. import os import re import sys def grab_email(file): """Try and grab all emails addresses found within a given file.""" email_pattern = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b',re.IGNORECASE) found = set() if os.path.isfile(file): for line in open(file, 'r'): found.update(email_pattern.findall(line)) for … | |
I am using: underscoredWord = Regex.Replace(word, "[^" + correctLetters + "]", " _"); for my Hangman game. It basically chops the word up and replaces all the text with an underscore. This works fine if the guessing word is only "one word". So the word: "Building" will get converted to: … | |
Hallo, How can i use Regex to match names in different files. e.g. i have 3 files with names. i need to link the matching names in the different file. any ideas. | |
Hello I'm not sure how this is possible but I want to enter a wildcard(?) into a php variable.. like this, <?php if($_SERVER['HTTP_HOST'] == '*.domain.com') { //do something } ?> Notice the * I basically need it to match if its any subdomain of domain.com Possible? | |
Hi everyone. I'm trying to convert an assembly code to its corresponding regular expression. I'm trying to match program patterns to discover anomalies. Being a novice in assembly language, i thought i would try to first convert a simple addition program to its corresponding expression before moving onto other code. … | |
well Guys i am not sure if what i want is atleast possible or not. what i want is to write a script in php, which will crawl through all my hard drive for all files and folders irrespctive of the file type and pick the emails address up and … | |
Soooo ... quick question :) I need to do some HTML parsing with regex :) I currently use `$output = preg_replace('/>\s+</', "> <", $output)` to strip whitespace between any two HTML tags. What can I do to strip whitespace only between paragraph tags. For example, only between `</p>` and `<p>` … | |
I have this Regular Expression in C#: Regex myRegex = new Regex(@"^[a-zA-Z]{1}\s(! | && | \|\| | -> | <->){1}\s[a-zA-Z]{1}$"); if (myRegex.IsMatch(expression)) { validated = true; } else { validated = false; } and I would like to match the following types of Strings: A && B A -> B … |
The End.