306 Topics

Member Avatar for
Member Avatar for trishtren

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 …

Member Avatar for masijade
0
274
Member Avatar for AndrisP

How I can passing quantifier as variable in this regexp `str.match(/^(\-)?\d+( (\-)?\d+){3}$/)`

Member Avatar for AndrisP
0
180
Member Avatar for domingo

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 …

Member Avatar for domingo
0
184
Member Avatar for devianleong

Hi, is there any preg_match only allow `a-zA-Z0-9():[space]` ? Please help me =(

Member Avatar for diafol
0
129
Member Avatar for Taruna_1

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 …

Member Avatar for vegaseat
0
320
Member Avatar for chris.kelley.5015

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 …

Member Avatar for Watael
0
268
Member Avatar for renierdbruyn

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 …

Member Avatar for pritaeas
0
444
Member Avatar for pritaeas

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 …

1
1K
Member Avatar for pritaeas

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

0
120
Member Avatar for prem2

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 …

Member Avatar for pritaeas
0
252
Member Avatar for asprin

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 …

Member Avatar for asprin
0
185
Member Avatar for Jahliah

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, …

Member Avatar for Jahliah
0
324
Member Avatar for tekagami

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

Member Avatar for LastMitch
1
371
Member Avatar for somjit{}

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 …

Member Avatar for pritaeas
0
162
Member Avatar for baby_c

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 …

Member Avatar for baby_c
0
202
Member Avatar for alismith

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 …

Member Avatar for iamthwee
0
417
Member Avatar for Jorox03

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, …

Member Avatar for Jorox03
0
6K
Member Avatar for Priti_P

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 …

Member Avatar for pritaeas
0
98
Member Avatar for LastMitch

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 …

Member Avatar for LastMitch
0
27K
Member Avatar for professor123

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!

Member Avatar for professor123
0
159
Member Avatar for debasishgang7

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 …

Member Avatar for TrustyTony
0
310
Member Avatar for deadsolo

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 …

Member Avatar for deadsolo
0
286
Member Avatar for t1suka

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 …

Member Avatar for IIM
0
161
Member Avatar for AleMonteiro

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 - …

Member Avatar for AleMonteiro
0
248
Member Avatar for scippi

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(); …

Member Avatar for henock
0
407
Member Avatar for swaroop.striker
Member Avatar for shama.shirva
0
3K
Member Avatar for deadsolo

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 …

Member Avatar for deadsolo
0
296
Member Avatar for b.wickham

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 …

Member Avatar for b.wickham
0
1K
Member Avatar for AleMonteiro

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 …

Member Avatar for AleMonteiro
0
238
Member Avatar for CoilFyzx

*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. …

Member Avatar for JamesCherrill
1
371

The End.