Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

Pass optional table parameter to a cucumber step (ruby)

I have a step that can be like this: Then I 'eat' all food except | Bread | Then I 'drink' all food except | Bread | | Milk | Then I 'eat' all food I decided to put some of the ...
laechoppe's user avatar
  • 250
0 votes
1 answer
97 views

Python Regex - optional match, do not capture one match

I'm trying to find an elegant way for matching negative and positive numbers at the same time, but not to capture the + sign while capturing the - sign. So I have something like: re.findall("([+-] \...
user10334946's user avatar
2 votes
1 answer
95 views

Regex find optional entries in Java

I'm currently working on some stuff with regex and struggel alot with regex latetly. I wanted to build some script engine, for that I need to load some presets: example: create <Type> [after;...
OetziOfficial's user avatar
2 votes
2 answers
115 views

Regular expression strings with consecutive variables

I'm fairly new to regex (regular expressions) and need a little bit of help formulating a string. I understand it for the most part but got stumped when the text I needed to match had variables ...
spatel4140's user avatar
0 votes
1 answer
73 views

Is Python (RE module) optional parameter handling inconsistent?

I'm experimenting with the regex RE module in Python 2.7. Documentation states that in the re.sub() function the count parameter is optional. If it's missing or set to 0, all matches will be ...
LoganW12's user avatar
0 votes
2 answers
548 views

PHP preg_match with optional math rules

I want to parse this string and get special values string to parse have one of these patterns app/(integer)/(integer)/(text or null) app/(integer)/(text or null) app/(text or null) I can use ...
Hossain Khademian's user avatar
1 vote
1 answer
350 views

Matching a string till a symbol and make it optional. Do not capture the matched optional string too

Match a string that ends with a ; make it optional and do not capture that group as it is not required. But do capture the rest of the string that occurs after the first condition. Text1: transfer ...
Designerztouch's user avatar
2 votes
1 answer
125 views

Multiple capture groups - all optional

I know this (or similar) has been asked a hundred times - but I really need help now :D The strings the regex should match. Note: n is in the range of INTEGER_MIN - INTEGER_MAX {number} {number(1-n)}...
Dennis Fischer's user avatar
1 vote
1 answer
217 views

htaccess internal errors with using (escaped or unescaped) dots

Maybe I'm doing something stupid, but I can't get rid of an issue with htaccess. I'm trying to match a function name in a documentation site and I'm getting errors I can't understand. I must point ...
�xel Costas Pena's user avatar
0 votes
3 answers
353 views

Optional match after comma in regular expression

I tried so hard and got so far but in the end it doesn't work!! What I would like to do achieve is the following: I've got a preg_replace_callback function where I want to address my "dictionary" ...
FinchSol's user avatar
1 vote
3 answers
2k views

Regex for matching optional parameters as groups in string

I am trying to read a batch script containing an input string of a command and optional parameters like input = 'command -a field1 -b field2 -c field3' The option parameters are set by a user in a ...
LoudKur's user avatar
  • 131
0 votes
2 answers
3k views

URL Rewrite - optional parameter?

I would like a regex string to reflect an optional parameter, in this case, a geographic state. I can accomplish this with two rules: <rewrite url="~/(.+)-(.+)/(.+).aspx" to="~/Default.aspx?city=$...
ElHaix's user avatar
  • 13k
0 votes
1 answer
63 views

How can you make a regexp in MOD-REWRITE optional?

I need to add a translation service to the job listings section of my site to make the content available in multiple languages. Right now, I'm using mod rewrite to make the following pretty URL: /...
MarathonStudios's user avatar