Regular expressions (often shortened to "regex") are a declarative language used for pattern matching within strings. Please also include a tag specifying the programming language or tool you are using.
0
votes
0answers
2 views
Regex.Replace with matched string in the replacement
I would like to compactly insert a <br /> tag before every line break in a string with regular expressions in C#. Can this be done? Currently, I am only able to replace the line break with the ...
0
votes
2answers
14 views
prevent regex matches both ahead and behind with lookarounds?
I'm trying to match a command through voice recognition on android. The recognition is fine but I'm running into trouble with crafting one of my regex patterns (the program uses java.util.regex)
I ...
0
votes
0answers
20 views
Regular Expression to extract php code partially
I have php code stored (( array structure )) in a string like this
$code=' array(
0 => "a",
"a" => $GlobalScopeVar,
"b" => array("nested"=>array(1,2,3)),
"c" => function() use ...
0
votes
4answers
27 views
javascript regex for region code
I have a regex problem with validation for a region code.
My region code could be only one digit but it also could be a digits separated by '-'
for Example my region code could be one of the ...
0
votes
0answers
7 views
Creating special characters modules for CodeMirror
How can I create a CodeMirror addon for filtering out special characters in a text area?
I've cloned the codemirror project and tried playing with "trailingspaces" example but it's getting me ...
0
votes
1answer
21 views
Trying to understand Railscast episode 197 (related to previous post: #17094200)
I am trying to make this work for my page, but I need to understand the regular expression replacement. Can someone break this down for me?
function add_fields(link, association, content) {
var ...
2
votes
3answers
34 views
RegularExpressions Extract All Decimal Values and Iterate Through
Say I had the String
<Records>
<record id='818591'/>
<record id='818592'/>
<record id='818593'/>
<record id='818594'/>
...
4
votes
4answers
67 views
Are there any regular expression engines that provide visibility into what they're doing?
In every programming language I've worked with, regular expression support (if it exists) is basically a black box: there are some functions like match, scan, etc. that take an expression and return ...
0
votes
5answers
29 views
String gsub - Replace characters between two elements, but leave surrounding elements
Suppose I have the following string:
mystring = "start/abc123/end"
How can you splice out the abc123 with something else, while leaving the "/start/" and "/end" elements intact?
I had the ...
0
votes
0answers
35 views
Issue getting href attributes
Using ColdFusion, how can I get the "my link alias" part out of the string below? It will always use the "alias" attribute, in case that helps.
<a href="http://www.google.com" alias="my link ...
3
votes
1answer
55 views
Why does this regex make Chrome hang?
Try typing this into Chrome's JS console. It's a regex I found to check if something's a valid URL or not:
"http://www.kvraudio.com/".match(/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w ...
2
votes
6answers
47 views
Trying to print matching regex in an awk program
i'm very new at awk and have been banging my head trying to get this to work. I'm trying to take a list of files in "image.list" and create an "info" file out of it. I need to grab the matching ...
0
votes
1answer
53 views
Verify this condition with regular condition
I have the following string:
"1,4,6,22,88,105:22"
How can I write a regular expression that checks the left part of the ':' and if one of the numbers is small than 'x' or greater than 'y' gives an ...
-4
votes
0answers
53 views
Arithmetic operators priority calculations [closed]
I'm trying to differentiate between the Arithmetic operators by their highest priorities. For example if I have an equation like 2*3+((5/6)-4) from what I've learned in school is that I should always ...
0
votes
4answers
21 views
PHP - replace all non-alphanumeric chars for all languages supported
Hi i'm actually trying replacing all the NON-alphanumeric chars from a string like this:
mb_ereg_replace('/[^a-z0-9\s]+/i','-',$string);
first problem is it doesn't replaces chars like "." from ...