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
4 views

phone regex space

I have this phone regex, but I want it to accept spaces.For example +57 52 5252255 should pass, but currently it's not passing.also "+91 9 820 09 8200" should passso a space anywhere is acceptable...
0
votes
1answer
10 views

oracle sql regex to extract words ending with a suffix (.sh .py etc)

can someone help with oracle regex to extract words ending with .sql .sh or .py in a string. ex sh /path/myscript.sh arg1 arg2 , i am looking for a way to only extract myscript.sh in sql.
1
vote
1answer
26 views

Ignore these two numbers (starts with 127 or 0) in the first octet of the ip address through python regex

I have a list of IP's stored in a text file along with some other data from which I am trying to grep only the valid IP's. Here, I have some IP's like 0.0.0.0 and localhost IP's (starts with 127...) ...
0
votes
0answers
10 views

Apache RedirectMatch permanent with regular expression

I want to redirect: http://example.com/tag/carto: http://example.com/car-pictures<VirtualHost *:80>ServerName www.domain1.comRedirectMatch permanent ^/tag(.*)$ http://example.com/$...
0
votes
1answer
25 views

How to make the regula expression correct?

I am not that familiar with regex or php, this line constantly return error:with preg_match, I tried to add / before and after it /^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`...
0
votes
3answers
31 views

Regex with different pattern

I have the following stringss1='XXX-2 I LOVE : XXX XXX's2='FOOD : XXX's3='XXX-FOOD : XXXI would like the followings1='2 I LOVE's2='FOOD's3='FOOD's2 only has 1 delimiter : while ...
0
votes
1answer
24 views

Phone regex to accept spaces

I have this phone regex, but I want it to accept spaces.For example +57 52 5252255 should pass, but currently it's not passing.var phone_regex=/^\s*(?:\+?(\d{1,3}))?[- (]*(\d{3})[- )]*(\d{3})[- ]*...
0
votes
0answers
26 views

Microsoft edge browser crashes the JS engine on regex replace

I found a way to mysteriously crash the edge JS interpreter but i have NO CLUE why it's broke. It works fine in firefox and chrome, but it blows up Edge entirely.var foo="Change or cancel my ...
-2
votes
1answer
16 views

Ruby regular expression - remove from a html string empty newlines

I would like to find a regexp in ruby that output a string after removing from the input string any br tag at the end of the string which is followed by nothing or followed by an empty space &nbsp...
0
votes
0answers
37 views

Regex to capture to specific percent/decimals

I am trying to scrape for interest rates in multiple sites. The data is pretty unstructured but close enough in form. What I want to capture:x.xx% to xx.xx%Examples of what the data looks like:...
0
votes
2answers
16 views

Ruby scan with optional match matches, returns nil except for optional

I'm running the following to catch a series of numerical values (floats and integers) in a string:Example:x="This is the 1st string with 2 quotes and took 3.4 seconds to write."Runningx.scan(...
0
votes
0answers
17 views

Using regex to replace a variable amount of groups within only part of a string

I'm attempting to use regular expressions to do quick fixes to HTML tables. I'm rather new to regex, so I've been stumped with this problem for a couple hours now:The input string will be a table, ...
2
votes
3answers
26 views

regex to add filename into html document

I am looking for a way to edit thousands of .html files adding them og:url with the URL basically taken from the filename. Basically, if a page is "page.html" I want:<meta property="og:url" ...
1
vote
1answer
24 views

Questions about using regular expressions [on hold]

I'm trying to learn more about regex and I'm running into a block my current query:function telephoneCheck(str) {return str.match(/[0-9]{3}[-][0-9]{3}[-][0-9]{4}/g)? true : false}This will ...
0
votes
0answers
29 views

Simplyfied regex in favour of maintability and readability

I've created a regex which seems to do it's job well, but 1) I'm using a part of it somewhere else in my programm and 2) it is not easy readable. And as I am not a guru in regexes and maybe I will not ...

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