Regular expressions (often shortened to "regex") are expressions written in a declarative language used for matching patterns within strings. General reference: http://stackoverflow.com/q/22937618 Remember to include a tag specifying the programming language or tool you are using.

learn more… | top users | synonyms (8)

-1
votes
4answers
31 views

working with character arrays in perl

I have a string say, s1='hello', I want to manipulate it like an array, example in c++ we can use s1[i] to address the characters individually of this array, how do we do it in perl? I want to add the ...
0
votes
2answers
16 views

Regex html structure not matching

I have a regex which matches to a standard html structure: <(.*)html(.*)>(.*)<head(.*)>(.*)</head>(.*)<body(.*)>(.*)<body(.*)>(.*)</body> which works fine for my ...
0
votes
2answers
60 views

splitting a string into an array with php

how would i go about splitting the following format string into an array? [13:05:37] [Server thread/INFO]: [0;35;1m[Server[0;35;1m] hi[m the string format is from a mine craft server and i believe ...
0
votes
2answers
34 views

PHP Regex pattern confusion

I couldn't make few regex patterns to work so i googled most of them and have encountered issues in the process. I mostly understand rules in play while building regex patterns but don't understand ...
0
votes
2answers
12 views

Escaping close-bracket character in grep complement

How do I escape a close-bracket character inside a character class? According to the manual, to match a literal ] it should be placed first in the list, but I need to match the complement of a class ...
0
votes
2answers
38 views

List out wrong email addresses

I'm using CodeIgniter PHP foreach loop to go through my email list, and find out any old emails that did not meet the regex requirement and list them out. I'm having a bit trouble displaying the ...
0
votes
2answers
34 views

Regex that finds consecutive or single words with first letter capitalized and aren't followed by a full stop

I am looking for a regex that can identify in a sentence the consecutive or single words in a sentence start with capital letters, excluding words after a full stop, which includes .,!? If we take ...
-1
votes
2answers
67 views

Regular expression validating html tags

I am trying to do one validation using regular expression, but still not getting success. I need to validate on of my input which may be blank/empty. but If user has entered some value in it, it ...
1
vote
1answer
50 views

RegEx finding item before not after

Im trying to get the value out of this element Needs to be by regex not xml as I need the word Description out of the element <ValueExpressionLeft ...
1
vote
1answer
364 views

Using regex_search from the C++ regex library

The regex_search function isn't quite behaving as expected. #include <iostream> #include <regex> #include <string> using namespace std; int main() { string str = "Hello ...
0
votes
1answer
9 views

301 .htaccess redirection from an URL that has a “?” character

I want to redirect at .htaccess every URL that has inside it a "?" character to the root of my site (domain.com). I have read this : 301-htaccess-redirect-with-special-characters ...
0
votes
1answer
59 views

In vs regular expressions with list of words

I have many HTML pages in which I need to check the existence of blacklisted words. I know that the built-in in is much faster then regular expressions but here I'm trying to compare many in against a ...
0
votes
1answer
17 views

Match only the matching block (ignore if the the starting word appears before the matching block)

I have my input as follows, Input StatusMsg: seqId: 14043 timestamp: 140707 dId: "Sa01" msgType: SEQUENCE eventType: UPDATE_CMD devContext { context: IDLE operationalMode: 1 logHistory { ...
0
votes
1answer
43 views

Need to use grep to find a string within a file

Im using a shell script to get a file using wget and search it for a pattern. My shell script is as follows: #Execute commands one by one while read line do STARTTIME=$(($(date ...
0
votes
1answer
42 views

RegExp getting around way

var clanBB = function (text) { var search = new Array( /\[box ([^\\"\n\r\t<]*?)\]([\S\s]*?)\[\/box\]/ig ); var replace = new Array( "<div ...
0
votes
1answer
29 views

Java Regex - Replace by index of a replacement string

From time to time when I migrate my Java web applications to different OSs with different installed JVMs, java.text.Normalizer.normalize() screws with me, in regard of stripping accents from ...
3
votes
0answers
29 views

Wildcard domain validator

I am going to add support of wildcards to my application. It should meet the requirement below. Wildcards must contain: - UTF-8 alphabetical characters - .,*,^,+,?,$,[],[^],:,/ - Domain parts ...
3
votes
0answers
36 views

.htaccess file acting strangely and not working with lowercase

The entire contents of my .htaccess file currently look like this: RewriteEngine on RewriteRule ^([a-z]+)/?$ index.php?page=$1 [NC] This should replace all urls that look like ...
3
votes
0answers
425 views

How to create custom function in a QSqlDatabase: regex in sqlite and pyqt

We define the python type REGEXP function in sqlite and python following Problem with regexp python and sqlite How can we do the same thing in PyQT, ie. with a QSqlDatabase? More precisely, we use ...
3
votes
0answers
696 views

Troubleshooting Emacs Tramp Connection that Used To Work--Password or Shell Regexp Wrong?

I'm trying to troubleshoot why an emacs+tramp connection that used to work doesn't now. At first I thought it might be an Aquamacs problem, but I loaded Emacs.app on OSX, based on version 23.3 (9.0), ...
2
votes
0answers
17 views

Can I set 'UNICODE_CHARACTER_CLASS' to All Pattern usages?

Can I set UNICODE_CHARACTER_CLASS flag to ALL Pattern usage in a single point? something like: Pattern.setDefaultOption(UNICODE_CHARACTER_CLASS);
2
votes
0answers
40 views

jquery validation not working only in regex

whenever i validate code,description,localisedDescription.my validate.addmethod have not working properly.could you please give me a solution ASAP so that my regex would work properly.These are the ...
2
votes
0answers
83 views

Parsing templates with Python-like if-blocks using pyparsing

I'm trying to parse a simple template language with pyparsing which looks kind of like this: if <expr>: <statements> elif <expr>: if <expr>: <statements> ...
2
votes
0answers
49 views

Replace callback works in VS2013 but not in ideone

Playing around with regex in VB.NET today and testing a simple replace callback lambda. The code compiles perfectly in VS2013, but ideone screams about it. Wondering if a VB.NET pro would have some ...
2
votes
0answers
60 views

Finding separating and processing repeatative blocks of lines with Python

I wrote the script which analyze the text containing the lines to be found: Uplink Bytes: 6168 Downlink Bytes: 40366 Uplink Packets: 69 Downlink ...
2
votes
0answers
113 views

Is there such a thing as a hard limit for regex matching?

I have this code I wrote for a routing component, here is the full code, which basically builds a batch of any number of large regexes (depending on a configuration value) out of many small ...
2
votes
0answers
85 views

ruby - decompiling pcre regex from binary

I have a binary file that contains a pcre regex. The regex hex start like this: 7F 00 00 00 00 00 00 00 11 00 6D 00 00 00 01 00 00 00 45 52 43 50 65 00 00 00 00 00 80 00 04 00 00 00 01 00 00 00 00 ...
2
votes
0answers
52 views

Is there a known locking or performance degradation in boost:regex 1.54?

Our software is relatively regular expression intensive. Some months ago we moved from boost::regex 1.33.1 to boost::regex 1.54. Lately we noticed scalability degradation. What it means is that when ...
2
votes
0answers
40 views

flex won't recognize my regular expressions definitions

i have a problem with writing definitions in flex in the L file. For some reason, flex doesn't recognize the name i give to the regular expression for example LETTER [A-Za-z] DIGIT[0-9] SPACE (" ") ...
2
votes
0answers
83 views

Pad regex-matches with spaces to uniform length

I am writing a Sublime Text snippet to insert the header to a matlab-function file. For that purpose I have the following lines: % Inputs: % ${3/(\b[^ ,]+\b)|([ ,]+)/(?2: :$1 - ...
2
votes
0answers
147 views

How to implement regular expression NFA with character ranges?

When you read such posts as Regex: NFA and Thompson's algorithm everything looks rather straightforward until you realize in real life you need not only direct characters like "7" or "b", but also: ...
2
votes
0answers
114 views

Chrome auto populate won't trip bootstrap-acknowledgeinput NOR jqBootstrapValidation

I use bootstrap-acknowledgeinput to make those nice checkmarks and found jqBootstrapValidatin as well, I use a two-stage browser validation, bootstrap-acknowledgeinput makes sure the field is not ...
2
votes
0answers
304 views

Simplified regular expression matching in Scala

I am trying to write a simple regular expression matching in Scala as an exercise. For simplicity I assume the strings to match are ASCII and the regexps consists of ASCII characters and two ...
2
votes
0answers
1k views

FileUpload - RequiredFieldValidator and RegularExpressionValidator do not fire

I have a FileUpload control for which I have attached a RequiredFieldValidator and a RegularExpressionValidator. My code in working fine on my computer, but in production neither the ...
2
votes
0answers
309 views

Struts2 JSON plugin includeProperties - not full regex support?

The documentation for Struts2 plugin version 2.3.x says that the includeProperties parameter can be set, and behaves as follows: A comma-delimited list of regular expressions can be passed to the ...
2
votes
0answers
237 views

freepascal regexp replace

Is there an easy way to do a RegExp replace in FreePascal/Lazarus? Hunting around I can see that I can do a match fairly easily, but I'm struggling to find functions to do a search and replace. What ...
2
votes
0answers
167 views

TFileListBox Mask Issue

The definition for TFileListBox.Mask is: Set Mask to a regular expression to limit the list box to files that match the mask. The value of the mask is a file name that may include wildcards. ...
2
votes
0answers
406 views

DevExpress XtraEditors TextEdit mask to completely replace exact string?

I have an exact string which is retrieved from a database. For sake of argument, lets use this as an example: string dataText = "set of characters"; I need to be able to replace that text with some ...
2
votes
0answers
407 views

Array search and replace with Sublime Text's regular expression

How can I search for multiple words and replace each one by a specific word using regular expression? In PHP it would be : $string = 'The quick bar foo jumps over the bazzy qux'; $patterns = ...
2
votes
0answers
913 views

Apache conf with Passenger and ProxyPassMatch regex for multiple Ruby on Rails apps

I have an Apache Sling app being served by Apache. However, when someone goes to the same url but has /mstarfb at the front of the url they get served by a Ruby on Rails app via Passenger. I would ...
2
votes
0answers
153 views

Creating a universal function of email image handling across multiple clients

I have a set of scripts that manages an email account and posts them to a MySQL table. Most email clients handle images inserted into the bodies as cid: and browser cannot view these links. So i have ...
1
vote
0answers
15 views

How to pass Regular Expression value to 'HTTP Request'

In "Http request default" i have set url has [jmeterbook.aws.af.cm] and in 'HTTP Request' i set the path as [/${ind}], In "Regular expression Extractor" i have given as, Reference Number: ind ...
0
votes
0answers
46 views

How to make a function to give values based on an object

I'm going to start by pasting my current code. var array1 = [741, 451, 54188, 5847, 5418, 54944, 310, 541, 7451, 10211, 113, 9115, 62, 2841, 52482481, 24]; var array2 = [15, 418, 488, 130000, 8482, ...
0
votes
0answers
30 views

Regex for Domain without Protocol

I have the following Regex to validate URL's: ...
0
votes
0answers
27 views

Any other ways to match url pattern in Spring security?

I have the following sample configuration for <sec:http> <sec:http authentication-manager-ref="blMyUserAuthenticationManager" disable-url-rewriting="true" request-matcher="regex" ...
0
votes
0answers
28 views

change scripts and images url in html

i've created a small php script to take cookies from mysql db and then login to a specific site with that cookie and return the page to the user (it is like the web proxy scripts but with pre-defined ...
0
votes
0answers
9 views

proxy.pac - using regexp to proxy site root but not subfolders

I have a bit of a strange request in that I am trying to use a proxy.pac file to use a proxy server for the following: www.domain.com www.domain.xx.xx www.domain.com/?foo=1&bar=1 (where foo/bar ...
0
votes
0answers
31 views

how do I extract all links from twitter feed?

I use "jquery-lifestream (https://github.com/christianv/jquery-lifestream/)" to get social feed from FB and twitter. It works fine. But I can't have all links clickable. FB links are OK twitter ...
0
votes
0answers
34 views
+100

Rails 3 - Precompiling all css, sass and scss files in a folder

So I have a project with page-specific styles and css. I've put those files into their own directory assets/#{type}/page-specific/ and I'm attempting to write a regex rule to inform the precompiler to ...
-1
votes
0answers
16 views

Auto Linking Urls when not in image tag

I have made a simple BBcode Parser for a Feed, I have tried different ways of auto linking static urls which are fed into the parser and some methods have worked but all break the image tags. Here is ...