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
6 views
How to align at/after last pattern occurrence?
Example:
this is my text, this is, this is my text
this, this is my, this is my, this is text
this is, my text, this is, this is my text
this, this is my, this is my, this is text
Normally, I use ...
0
votes
1answer
16 views
regex capture bind parameters following a colon
I'm trying to match substrings that follow colons : without matching the colon as well. It should be really simple. Given
select * from table where name=:name, id = :id order by :order_by limit ...
0
votes
0answers
29 views
Regex expression to split @ #
I am a newbie to the world of regular expressions. I basically need to split a string based on '@' and '#'.
My string is in this format : @xyz #hello @tim #temp.
Can anybody please help me find a ...
-1
votes
1answer
72 views
How to split a string by “/” and “//”?
I'm trying to create a basic model viewer for Wavefront Object files, and part of the reading of the file includes splitting each line. The faces are defined based on slashes. These are the ...
0
votes
4answers
25 views
Using regexes to find result from HTML table
I am stuck with some regular expression problem.
I have a huge file in html and i need to extract some text (Model No.) from the file.
<table>......
<td colspan="2" align="center" ...
1
vote
1answer
24 views
How to extract integers from string using ruby regex?
I am fetching arbitrary string from different sources that might contain integers. Examples:
1- "He owns 3 cars"
2- "John has $23 and 50 cents"
3- "The range is 1-12 cm"
I would like to parse them ...
0
votes
2answers
27 views
Calling a function on captured group in re.sub()
>>> base64_encode = lambda url : url.encode('base64').replace('\n', '')
>>> s = '<A HREF="http://www.google.com" ID="test">blah</A>'
>>> ...
2
votes
2answers
42 views
Re.sub in python not working
Suppose that:
s = '<A HREF="http://www.google.com" ID="test">blah</A>'
I want to prepend the url with "url: ", so I tried:
s = re.sub(r'href="([\w:/.]+)"', "url: " + r'\1', s, re.I)
...
0
votes
1answer
37 views
Lookbehind in python
Suppose I have:
string = "2 dogs. 4 cats. 9 horses. 7 goats"
I want to match every word that precedes a number.
I tried:
matches = re.search(r"(?<=\d+) \w+", string)
but it isn't working.
3
votes
2answers
36 views
Need regex to match the exact number of spaces found in a mask
So I'm writing a program to print music books based on files found. I already have the option of reading the tag finished but parsing file names is much faster so I decided to make it an option. The ...
2
votes
2answers
37 views
Regex to read tags Python
I want to read elements within tags with regex, example:
<td>Stuff Here</td>
<td>stuff
</td>
I am using the following: re.findall(re.compile('<td>(.*)</td>'), ...
-5
votes
0answers
41 views
assistance with regular expressions is needed [closed]
I've tried to understand how to write a regex that will match for me a pattern with the following characteristics:
specific characters - I'm guessing the use of square braces "[]"
only one of them ...
0
votes
1answer
33 views
Master JavaScript Regex Guru Needed For Recursive Filtering
I'm in serious trouble with a JavaScript regex. What I want is "regex only" solution to perform transformations like this :
{{ users.name.find(50, "q")|lower }} ---> lower(users.name.find(50, ...
-1
votes
2answers
44 views
How to find the combination of words that includes all the letters in the input with Python
I want to find the most efficient way to loop through the combination of letters that are entered in Python and return a set of words whose combination includes all the letters, if feasible.
Example: ...
0
votes
1answer
12 views
ext js 3.4 RegExp filtering
How can I make something like this in my filtering in grid
var filters = [
{
fn: function (item) {
return (item.get('Name') == new RegExp(".*" + productValue + ".*"))
...