306 Topics
| |
Hello, im currently working on a program to split a string based on symbols only, i need to seperate the string around the symbols whilst keeping the symbols as well eg. test_String_123_^; would result in an array containing : [test] [_] [String] [_] [123] [_] [^] However although i have … | |
How I can passing quantifier as variable in this regexp `str.match(/^(\-)?\d+( (\-)?\d+){3}$/)` | |
Hi all, i was trying to create a URL rewrite regex. The regex is something similar to this: \/pa\/*([0-9,a-z,A-Z,-]*) This regex works fine but i want to make this regex more dynamic so instead of "pa" i want that it matches any characters a user inputs. I create a regexr … | |
Hi, is there any preg_match only allow `a-zA-Z0-9():[space]` ? Please help me =( | |
Hi, I want to replace all the character in my string with 'aaaa' as many number of times as there are occurence of the character. For eg. if my string is "cat", output should be "aaa" and if its "hello" output should be "aaaaa". As of now, I am using … | |
Hello, I am trying to create a script that will compare one word at a time from one file to every word in a second file. I know how to design nested for loops to read the first entry in file1 and compare it to every entry in file2, so … | |
Hi there.... I need help with a regex, I need a regex to check if the qualification types are valid, e.g. Bachelor's degree, Honours degree, National Diploma, B.Tech(BACHELOR OF TECHNOLOGY), etc... I have to check if the user's qualification matches the reqiured qualification. I have: if($user_qualification == $required_qualification){ //do something … | |
The following code snippet shows how you can parse a DSN (Data Source Name). Why is it useful? You can now pass a single DSN parameter to your database wrapper class' constructor (instead of five separate parameters), and tear it apart into the components you need. The password and port … | |
For all people having issues building the right regex: I just came across this nice little helper, which allows you to describe what you want using chained methods. https://github.com/jehna/VerbalExpressions | |
Hi guys, I am struggling with regular expression.Can you please suggest the regular expression for the below patterns. I have tried many times with several patterns but still i could not resolve the below patterns. 1. Must contain at least one alpha character (i.e. a, b, c etc,) 2. Only … | |
This is really a spoon feeding request. I'm in the process of learning regex, which will take time to perfect, but as of now I'm in immediate need of help to work on regex expression. Suppose I've a string like $str = "asggasdg46%dgeoweg5.3%sdgeoge4%kge"; In the above string, I need to … | |
I'm trying to get the time from input of html txt_URL but the array returns nothing. Not sure where I went wrong. Any help is appreciated. Thanks! **input:** Deleting 11 files. Details: Time Deleted = 01:16:30, Time Left = 00:00:00, **output:** 01:16:30 string before = txt_URL.Value; string after = Regex.Replace(before, … | |
1) onkeyup send textarea values to script 2) converts textarea value to array 3) loops thru the array 4) uses regex to check if its an email address 5) changes inner html of recipient div | |
my string (str2) = "aaaabbaacc" i wanted to parse out the two a groups. some trials had worked according to plan , while a few , are giving me outcomes i dont understand. im hoping the members could help me out :) problematic regexp 1 : `console.log(str2.match(/a+(a+(?=c))/).toString());` this gives "aa … | |
Hi, I'm currently working on a open source project that will enable the regex library help for the software. I have downloaded the pcre regex library and I know it can be build and run separately. I want to know what are the guide lines and the path which I … | |
Hello I'm want to convert string to array $str = "[cat=[0=php,script=[js]],id=4,foo=bar]"; how to write `preg pattern` for change `$str` to : $str = "[cat=[0=php,script=[js]]_-_id=4_-_foo=bar]"; If convert `,` to `_-_` I can convert this string to array by `foreach`, but i can't convert `,` to `_-_` in this string I'm want … | |
I am trying to write some code to regex search against wide strings. The problem I am having is that the regex operations ( `regex_search` in particular ) does not take in wide arguements. Here is the snippet I am having trouble with: Function Header: void scan_filesystem( wpath const& f, … | |
I have atext file but I want to pick a phone number from that file. How can I? is there any regex for this? How to write regex which gives output as 10 continuous digits (which will be phone number!)? Other things like what if +91 is addedd and all … | |
| Hi I'm trying figure why I'm getting this error **Undefined offset: 1**. I'm practicing with **list()** function and with a **explode()** function. When I ran the code it kept mention this error: Undefined offset: 1 The line is this: list($bagsize, $candyprice)=explode("#", $_GET["size"]); The list is not an array. It's on … |
hie i have a php form which will require a user to enter an ID Number in this particular form e.g. 34 1297336 Z 42 how to i create an easy and neat validation for that field. thanks any help will be appreciated! | |
Hi Guys, I am trying to modify an xml string on the fly. I will enter a sample XML string and the code should generate modified xml.I have exploied it later. xml = xml = '''<FixedPage xmlns="http://schemas.microsoft.com/xps/2005/06" xmlns:x="http://schemas.microsoft.com/xps/2005/06/resourcedictionary-key" xml:lang="en-us" Width="793.92" Height="1122.24"><FixedPage.Resources><ResourceDictionary><LinearGradientBrush x:Key="b0" StartPoint="0,0" EndPoint="0,1122.24" ColorInterpolationMode="SRgbLinearInterpolation" MappingMode="Absolute" SpreadMethod="Pad"><LinearGradientBrush.GradientStops><GradientStop Color="#FFFFFFFF" Offset="0" /><GradientStop … | |
Hi there everyone, I am having some difficulties getting a regular expression to work. I have a line of text with 5 numbers.I want to ignore the first number, and grab the other 4 numbers. Here is what the text I am dealing with looks like. 1681 12.33754513 7.066246057 6.079261254 … | |
In brief, I am puzzled as to why `~^[0-9]*?\|[0-9]*?\|.*?\|.*?\..*?\|2\|[0-9]\|.*?$~m` matches `1362526368|5|Corinne E. Fischer|fischer.jpg|3|3|FischerC@smh.ca|416-864-5320|1|2|3|4|5` Note the |3| after fischer.jpg when the pattern clearly has a \|2\| in that location. Now I understand that it must be the numbers at the end that are messing with the match but I don't really … | |
Hello guys, I'm in need of some thinking help. I want to build an auto-complete text input to find cars, but I want it to search for Car Models and Car Manufactor too. In example, if the user type 'For', the suggestions would be 'Ford - Car 1' 'Ford - … | |
Hi everyone, I am using this method to read in a collection of ints and strings then converting the strings to numbers using the switch statement(as stated by my lecturer) and save it back into an array for further processing. However, everytime it gets to the line studentResponses[row][column] = scanner2.nextInt(); … | |
Could someone please tell me hw 2 validate e-mail address on an event in vb.net?? | |
Hi there, I am having some trouble with a regex and am hoping on one of you great folks can assist me. I am very weak with regular expressions just to give you guys a heads up. Here is the text I am using a regex on: Control flow 6881 … | |
I've been having trouble with an UPDATE statement in the code below. The problem is that each time I submit the form to update an existing record in the products table, the records won't update. When I submit the form there is no error message and it redirects to the … | |
Hi everybody. I'm trying to insert an indented code inside another indented code, using the first indentation as base for the second. I mean, the second indentation must begin at the end of the first. The indentation i got working right, but it is adding some undesired line breaks, that … | |
*I know that this may seem like a re-occuring question, but I can't seem to find anyone who has asked this question in a very succinct manner. They always seem to beat around the bush, instead of clearly expressing themself.* **Here is the situation:** I have an application called S.M.A.R.T. … |
The End.