Linked Questions

3 votes
1 answer
197 views

How to use `Shortest` for pattern matching? [duplicate]

For the string ((!@#)), the shortest match for the pattern "("~~__~~")" should be "(!@#)", ...
arax's user avatar
  • 1,831
0 votes
0 answers
40 views

Shortest[] didn't work for StringReplace for shortest consistent match if whiteSpace involved [duplicate]

This is a problem related to How to use StringReplace "from bottom to global"? The answer of @J.M. works well for "<...>" styles : ...
Harry's user avatar
  • 2,745
19 votes
4 answers
739 views

Balanced Shortest[] and string patterns

The pattern Shortest["A"~~__~~"B"] is oriented : It assumes the text is read from left to right and it takes the text between the first ...
andre314's user avatar
  • 18.6k
5 votes
2 answers
673 views

Extract string words from string [duplicate]

Hi i'm new to programming and it's my first question, so please go easy on me. I want to create a function that extracts text which is between BEGIN and ...
joweyedete's user avatar
7 votes
2 answers
237 views

StringCases and Shortest from right to left

As explained in https://mathematica.stackexchange.com/a/72293/45020, using Shortest in StringCases does not actually return the ...
Kvothe's user avatar
  • 4,491
6 votes
2 answers
212 views

StringPattern to remove markers around text

I am not able to figure the StringPattern to use to remove markers in string. This is the input. ...
Nasser's user avatar
  • 145k
5 votes
2 answers
233 views

StringCases with string replace and with escape characters

I want to extract url address of all css files inside HTML source. First output is as expected. But why second and third outputs are different? Notice that only "href" was removed from ...
azerbajdzan's user avatar
  • 18.7k
1 vote
1 answer
269 views

Dealing Repeated pattern in StringReplace

A problem about StringReplace When I'm running into this problem possible [bug] ...
HyperGroups's user avatar
  • 8,619
4 votes
2 answers
83 views

problem of `Shortest` and `StartOfLine` in string match

Say I have the code below to extract those lines with "::" in a string snippet: ...
sunt05's user avatar
  • 4,367
5 votes
0 answers
115 views

Pattern match Shortest BlankNullSequence in SequencePosition

Apologies if this has an answer somewhere but I can't find it. From the examples for SequencePosition we are shown that ...
Quantum_Oli's user avatar
  • 7,964