Skip to main content

Questions tagged [regular-expressions]

For questions about the function RegularExpression which is used in string patterns in functions as StringCases, StringReplace, StringPosition,StringCount etc.

3 votes
3 answers
107 views

Extract doi from a text string

I have a large list with bibliometric information including the doi like this example: ...
M.A.'s user avatar
  • 731
1 vote
1 answer
62 views

Difficulty using StringCases to obtain desired substring

I have extracted and stored some plaintext strings (derived from a pdfs) from the web that I wish to search for various values following certain text substrings that are different for different ...
Stuart Poss's user avatar
  • 1,893
3 votes
2 answers
140 views

Small trouble with variable referencing in StringReplace?

I am trying to do the following: Take a string abcdEFGpcf and replace whatever is between abcd and ...
Red Banana's user avatar
  • 5,411
2 votes
1 answer
88 views

Is there a function which checks the validity of a string to be used as argument to RegularExpression?

Is there a function which checks the validity of a string to be used as argument to RegularExpression? Composing regular expressions is not an easy task. In ...
Adalbert Hanßen's user avatar
1 vote
0 answers
41 views

A successful StringReplace with an error message [closed]

An example of StringReplace and RegularExpression : ...
imida k's user avatar
  • 4,315
6 votes
1 answer
90 views

Split a multi-line string at the beginning of each line using RegularExpression

I want to replicate the following code using RegularExpression instead of StartOfLine: ...
podge cassidy's user avatar
5 votes
2 answers
249 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
  • 20.1k
4 votes
2 answers
2k views

How can I split strings with regex so that only numbers are selected

examples ...
mrz's user avatar
  • 11.7k
3 votes
3 answers
166 views

Regular Expressions in FileNameJoin[]

I'm attempting to create a list of folders that match a particular pattern. For example, consider I have the following files in a directory structure: ...
Karl's user avatar
  • 316
4 votes
1 answer
205 views

How to extract Table data using regular expressions?

For example, the Table have follows structure: ...
lumw's user avatar
  • 593
0 votes
0 answers
86 views

Why my code give empty plots? AND When I increase the number of mx , mt my code is running for a long time

In my code, two graphs are not displayed. what is the problem?Also when I increase the number of mx and mt, the code enters the running for a long time. The regularization problem is described as $D^{...
user68119's user avatar
5 votes
2 answers
240 views

using StringReplace and StringPattern to convert exp(...) to Exp[....]

I am looking at a file generated by another CAS. I'd like to convert it to Mathematica syntax. Only issue is how to convert exp(....) to ...
Nasser's user avatar
  • 147k
0 votes
0 answers
35 views

Correcting Import Errors presumably caused by unwanted whitespace characters

In scrapping data from a website that has a list of references searchable by the first letter of the author. I have attempted to Import this as a single html file for each letter. Oddly, this works ...
Stuart Poss's user avatar
  • 1,893
3 votes
1 answer
85 views

How to do context-sensitive matching with the pattern system?

In Perl RegEx, we have the look-ahead/behind feature; it there a similar functionality available for Wolfram Language patterns? Re @mikado: Suppose we have a random expression in ...
Gravifer's user avatar
  • 872
1 vote
3 answers
69 views

How can I let StringPosition consolidate overlapping matches?

Consider an example like this one: StringPosition[" -aa.ef -ag.hi -aa.ei", RegularExpression["\\s+-(?=a+\\.)"]] which returns ...
Adalbert Hanßen's user avatar

15 30 50 per page
1
2 3 4 5 6