306 Topics
| |
Hey everyone! Happy New Year! I am trying to hone my programming skills by writing simple applications. I created a very simple currency converter program (hard-coded exchange rates....so nothing special). I first created it as a console app, and then in WPF. Anyway, I ran into an issue with the … | |
I am learning re module for practice I have taken an export of my phone addressbook which is a comma seperated text file, containing "First Name","Mobile Phone","Home Phone","Company","E-mail Address","Company Main Phone","Business Fax","Birthday" as of now I am more interested in First name , mobile phone number and email address. in … | |
I'm trying to find two cases in a test string. _Large and jpeg Here is my string : E:\Music Test Folder\Lamb of God\Wrath\AlbumArt_{F5969BAB-11BC-49E0-9B56-B6E9654204B7}_Large.jpeg And here is my expression: Match large = Regex.Match(file, @"^.*(_Large).(jpeg)$/i", RegexOptions.IgnoreCase); I cannot get a match. What am I doing wrong? | |
Dear Experts, I have one simple question , and forgive me , I know it is simple , but I am very bad in regular expression. I have a text which represent time interval , eg [1-5] , ie , the start time is at 1 and ends at 5 … | |
hi friends. i want to try the fee collection system in vb.net. my need is that a reminder remind me the name of defaulters on 20th date of every month. it check the defaulters from database. please hlep me frinds how can i do this. | |
Hi, I have a string like this: ABC_STRING_DEF_GHI_JKL. Where the "STRING" part is constant. I am trying to get its corresponding regex pattern. Something like %_STRING_%_%_% So far I managed to get to this point: SELECT 1 FROM DUAL WHERE REGEXP_LIKE('abc_STRING_def_ghi_jkl', '(^(\w[^_])+)_STRING_([^_]+)_([^_]+)_([^_]+)$'); It's not really working, so if you have … | |
I've been really struggling with regex lately ... I never quite got the hang of it. I'm currently hung up on trying to match on the following in my .htaccess file: ^foo/([A-Za-z0-9]+)/([0-9]+)$ The catch is that I want the alphanumeric string to *NOT* be one of a short list of … | |
Hi, I need help in writing a regular expression accoding to the following criteria: preg_match (keywords tel/contact/phone/phne/telephone which can be found anywhere in the string) followed by 7 int(numbers). Thnx, Regards, Sami | |
Hi... I am using following query to get data from a table *select * from emp where ename regexp 'rajkiran'* It will return only the rows with ename=rajkiran but I want to select all the rows with ename =raj kiran & ename=rajkiran using a single query | |
I am developing a script that takes an article, searches the article for a "keyword" and then randomly replaces that keyword with an anchor link. I have the script working as it should, however I need to be able to have an array of "replacements" for the function to loop … | |
Hello. I've been through dozen of tutorials about regex, and obviously still don't understand everything. I'm trying to get data (a whole DIV field and its contents) from another website, and display it on my page. It seems to get everything, but the DIV field. This is what I want: … | |
Hi, I need help creating or manipulationg my current regex that will grab two numbers from a line, while excluding a specific number. Here is an example of what the line will look like: "In our tests, downloads on port 6881 achieved up to 12059 Kbps while downloads on port … | |
I am making a basic craigslist type website with a search function. There is a field where you can enter what you think the name of the product might be and my search function is supposed to find names of products that match. so for example a user can enter: … | |
i am having the code if (eregi($file,$_SERVER["HTTP_ACCEPT_LANGUAGE"]) && !$use_lang) $use_lang = $file; This line of code is giving error:-Deprecated: Function eregi() is deprecated in C:\xampp\htdocs\spm\includes\header.php on line 15 | |
Hi, I am currently working on a script that will compare two numbers from a file. I am thinking that I need to use a regular expression in order to get the numbers, however I don't know what the regex would be since there are multiple numbers through out the … | |
| Hi I'm bit stuck on how to put a period in array. This is my example: <pre> <?php $str = 'I like to eat Strawberry Cheesecake.'; $words = preg_split('@([\W]+)@', $str); var_dump($words); ?> </pre> This is how it's `var_dump()`: array(7) { [0]=> string(1) "I" [1]=> string(4) "like" [2]=> string(2) "to" [3]=> … |
Hello Everyone. Can you please advise how can I replace a string from this "[" to "]" this character and replace it with blank string? I believe I will use str_replace but I am having a hard time doing this. The quick brown fox jumped over [caption id="attachment_223" align="alignleft" width="900"] … | |
I have this pattern which finds links, inside a text string from file_get_contents function. Works fine, it seems. But I am curious to understand the expression, each charachter of it, what it does etc. Here you go: preg_match_all('~href=("|')(.*?)\1~', $var, $out); I know what it does obviously, but what does (.*?)\1~ … | |
Hi.. I used following regular expression "/^[0-9]{1,2}\-\[0-9]{1,2}\-\[0-9]{4}$/" for email validation. It won't check the mail id like "testmail@gmail" . It will work "testmail@gmai" Can anybody suggest solution for this? | |
Hello I am trying to build a function that i can use in to search for an object or item from its name, Here is what I have in **sfind.py** def findobj(searchTxt,items): """ This function will help you find an object or an item from list of items passed to … | |
hi everybody i just need to know what is the function of preg_split and that which is inside of brackets: $keywords = preg_split ('/[\s]+/',$keywords); | |
Hi all, hope you are having a better day than I am... I am trying to write the results of a search of text using preg_match_all to a database... First thing I need to do is write the results of the search to an array (which preg_match_all does)... It writes … | |
Recently bought "Regular Expressions Cookbook 2nd ed." and wanted to share my findings. The book is divided into two parts. The first part (3 chapters) describes tools, skills and programming. The tools chapter shows you what's out there (including his own software). The skills chapter is a tutorial. It describes … | |
I have a simple question about regular expression and Im new to php so sry about my bad questions , what is the meaning of ^ and $ in regular expression and please give examples that if we dont put them it will go wrong . thank you | |
Hi guys! I've been using PHP for fun for a while, and now I'm interested in playing with some scraping. I know regex is the way to go. So I'm trying to scrape a page of 4chan. I want to grab the images and the title of the thread of … | |
| Hi all. AM having a little issue with regex. Not one of my strongest skills! I'm trying to produce a simple translation system that doesn't require arrays, gettext etc. It basically has this structure: $content=<<<CONTENT <p>{{Dyma destun||Here's some text}}</p> ... CONTENT; So the page content is held in a var … |
Hi, I've got a set of folders with each contain many files. I need to extract a specific file extention(.sof) from each of these folders to a new directory(or the same directory in a new folder). Any help is appreciated. Thanks. | |
Hi I'm working on a form validation script. Up to this point, I've only written very basic regex validations. The input that I'm trying to validate should have entries in the following format AAA111 separated by comma space. So some sample entries are : `ABC111` or `ABC111, ABC112, ABC113`. Here's … | |
Hi, I have a HTML page in one variable. I need build a mehod that will extract a tag content (dif extract_tag(self, tag_name)). For example, given webpage: <div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <!-- content --> <div id="content" class="mw-body"> <a id="top"></a> <div id="mw-js-message" style="display:none;"></div> <!-- sitenotice --> <div id="siteNotice"><!-- centralNotice … | |
I have the following code. I wanted to determine if the value inputted in $cellno (from a textbox) are all digits (numbers), and if it's 11 numbers, and if its starting numbers are "09". One correct value example is 09345678910. It is all numbers, has 11 digits, and begins in … |
The End.