Questions tagged [regex]

Regular expressions provide a declarative language to match patterns within strings. They are commonly used for string validation, parsing, and transformation. Since regular expressions are not fully standardized, all questions with this tag should also include a tag specifying the applicable ...

0
votes
0answers
9 views

Regular Expression - starting with one string OR ending with another

How can I create a regex to find a string that starts with one string or ends with another string, but cannot contain both strings?For example:start="x"end="y"string="test"valid ...
0
votes
0answers
9 views

Minimization of Regex

[Reopening the question as none of the prev posts answered my question]I am trying to create a common regex that would match only list of strings given, nothing more than that.For Eg., given the ...
0
votes
0answers
5 views

Regex in htaccess : exclude double minus sign

Currently usingRewriteRule ^(english|french)/.+/.+/([^--]+--)(.+\.(jpg))$ /upload/$3 [L]For /english/shopping/computer/dell--prodimage-large0159.jpg to /upload/prodimage-large0159.jpgBut not ...
1
vote
1answer
9 views

Regular epression to match directory paths using joi + express

I am trying to find regexp to match directory path using joi and expressMy requirement is thistest/upload- Validtest/upload/123/123/123/ - valid (These can be a nested folder)I have tried many ...
0
votes
0answers
7 views

Rexex subroutine works in Npp but behaves strengely in PCRE

Trying to learn Regex subroutines. I made this Regex to match IP addresses. It works in Notepad++, but when I tried it in a PCRE tester in the net it only matches IPs with at most 2 figures in the ...
1
vote
1answer
16 views

What is the REGEX for ALAA-123456

I'm a newbie at php. HTML form is capturing data and mailing it to user via php.I am trying to make this field have a default value of "ALAA-" and then only permit 6 numbers after "ALAA-". I believe ...
0
votes
1answer
12 views

Matching list symbols in regex (angular 2) [duplicate]

I am trying to match the list of symbols in regex but somehow the result is always returning with errorssymbol list=!@#$+*{}?<>&’”[]=%^if (text.match('^[\[\]\!\"\#\$\%\&\'\(\)\*\+...
0
votes
1answer
17 views

Output all text files and its regular expression match-using more than 1 regex

I am trying to filter all txt documents in my director with multiple regular expressions, and the output to show all the files that contain any of the four regular expressions below and its match per ...
-1
votes
0answers
17 views

Tokenizer that splits on whitespace and lowercases tokens in java

I wanto to create a tokenizer that splits on whitespace, lowercases tokens and I'm using Netbeans. I'm having trouble in finding a expression that works for both whitespace and lowercases. I'm using ...
3
votes
1answer
24 views

Regular Expression except [Value]

I have a String and want to replace it with other String as given in mssqlFunctions object.var mssqlFunctions={DateDiff: "DATEDIFF",Abs: "ABS",y: ...
-1
votes
0answers
13 views

Regex style language for Notepad++

Couldn't find anywhere xml style for regex for Notepad++
1
vote
2answers
31 views

Regular expression in RegularExpressionAttribute behavior

I am using this regular expression: @"[ \]\[;\/\\\?:*""<>|+=]|^[.]|[.]$"First part [ \]\[;\/\\\?:*""<>|+=] should match any of the characters inside the brackets. Next part ^[.] should ...
-3
votes
0answers
20 views

How to search for subscript characters using regex ? html php

I have build an application which update ebay items description , according to ebay the desciption shouldn't contain subscripts .Here is what they say :It's against our policies to do anything ...
2
votes
3answers
38 views

use a regex to split a pipe(|) separated string but ignore pipes in brackets [duplicate]

Suppose I have a string like this in php(laravel): make|aaa|select.aaa|ttt|actived_by(creator.url|test|ali)Now I want to convert it to an array like this: makeaaaselect.aaattttactived_by(...
0
votes
0answers
7 views

exactly march by regex [duplicate]

Could you help me write correct RegEx formula for search text area from "From:" till end of line "Subject"?My RegEx formula: From(\n|.)*Subject.+(\n) is not correct - it will math from first "From:" ...
1
vote
0answers
34 views

Minimization of the regex

I am fairly new to Programming world. I am trying to create a common regex that would match only list of strings given, nothing more than that. For Eg., given the below listList=['starguide,'...
0
votes
1answer
19 views

How to match encrypted text between two strings, any idea what's wrong in my Regex?

I'm trying to match a verilog text that begin with `pragma protect begin_protectedend ends with`pragma protect end_protectedusing this Regular expression`[pP][rR][aA][gG][mM][aA]([\t ]+)[pP][...
0
votes
3answers
43 views

Regex for getting only the last N numbers in javacript

I've being trying to generate a regex for this string:case1: test-123456789 should get 56789case2: test-1234-123456789 should get 56789case3: test-12345 should fail or not giving anythingwhat I ...
0
votes
2answers
25 views

Find and replace with regular expression in Notepad++

At the moment, I have a PHP function that gets the contents of a CSV file and puts it into a multi-dimensional array, which contains text that I print out in various places, using the indexes.an ...
1
vote
1answer
33 views

Extracting multiple dates from text in python

I have a DataFrame that looks like thisUnit ID Shipping to:90 With x91 With y92 With z116 Shipped to x 01/04/16. / Shipped to y - 09/08/18.233 Shipped to z 03/...
-1
votes
0answers
17 views

What is the Regular expression for validate following mobile numbers? [duplicate]

Mobile numbers are here...017273790680181363459901935689425016354879980153264785904465987565Question No 1:We can say every phone number starts with "0" and can not be start with "00" and ...
0
votes
1answer
39 views

Bash / Regular Expression Conversion

I'm new to RegEx and have a working RegEx pattern that doesn't seem to be Bash / Shell compatible. I've been reading around that \d isn't supportable in Bash. Can anyone help me try to understand the ...
1
vote
1answer
26 views

Extract first and last name from email address

I've seen a variety of this everywhere but nowhere that answers my questions specifically. I need to extract a first name and last name from an email address but also need to make the case proper with ...
-4
votes
1answer
26 views

Web Crawler Issue in PHP

This application will act as search engine to extract faculty related information from different (at least 200) academic institutes including Universities, colleges and other Training institutes. This ...
-1
votes
0answers
45 views

Regex: extracting text from documents

I try to extract some data from textText looks like38MS0010 г. Иркутск Ул. Кожзаводская38MS0010 г. Иркутск Ул. Ангарская38MS0010 г. Иркутск Проезд Карлукский38MS0010 Переулок Селитбенный...
-1
votes
1answer
22 views

python regex need help to enumerate data [duplicate]

I want to enumerate '4.9.8' from this line. how can i get that. i am new in Regex.import reline="<script type=\'text/javascript\' src=\'https://js-sec.indexww.com/htv/htv-jwplayer.min.js?ver=4....
-3
votes
0answers
33 views

Regular expression for field validation in c# [duplicate]

I'm not good at regular expressions. I need to do the validate if a password is correct or not.Conditions:Your password can be 8-32 characters long and it must includeat least two of the ...
-1
votes
0answers
21 views

Regex in htaccess problem multi language redirect

This is Working wellRewriteRule ^test/([^-]+-)((?1))((?1))(.+\.(jpg))$ /wordpress/wp-content/uploads/2018/10/$4 [L] But when I tried with this for supporting multi language, it's not working....
1
vote
1answer
18 views

How to substitute part of substring using regex in VBScript?

I'm reading a text file in VbScript line by line and storing the value each time in a variable called line_text.The line_text variable can take values as":60F:C180235P56987456"":60M:...
0
votes
2answers
29 views

PHP - Extract current directory and filename from file path

I need to turn this:/home/me/public_html/folder1/folder2/folder3/script.phpInto:folder3/script.phpSo far, I have tried using:(\/.+\/.+\.php)$However the end result is the entire path is ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,