Questions tagged [qregularexpression]

The QRegularExpression class in Qt 5 and 6 provides pattern matching using regular expressions. This tag is for questions about the use of regular expressions in the Qt library. For generic questions about regular expressions, use the "regex" tag.

The QRegularExpression class provides pattern matching using regular expressions in the Qt framework.

The regular expression syntax in QRegularExpression is modeled after Perl (PCRE).

Note: This class is new in Qt 5. Qt also offers an older, slightly less capable regex implementation though the QRegExp class.

Usage example for finding all numbers in a string:

QRegularExpression re("(\\d+)");
QString str = "Offsets: 12 14 99 231 7";
QStringList list;
QRegularExpressionMatchIterator i = re.globalMatch(str);

while (i.hasNext()) {
    QRegularExpressionMatch match = i.next();
    list << match.captured(1);
}
// list: ["12", "14", "99", "231", "7"]

Read on in the official Qt documentation for Qt 5.

120 questions
0
votes
1 answer

How can i set multiple parameters and dynamically to pass from one api response to another api request

I need to pass two different parmeters, That is RideNumber and RideId from response of one api to other two different api's. Tried to keep two different regular expression extractors but did not work. I tried by keeping two Regular expression…
Devi
  • 1
  • 1
0
votes
0 answers

Regex by group not working in RAD software

i am using below regex with group name in rad software regular expression which is working fine individually but when i combine them - grouping misbehaves regex1 - Throughput\s*\|(?[\d\.]+(?:\s+\w+)) regex2 - Connection…
Kumaresan Sd
  • 1,399
  • 4
  • 16
  • 34
0
votes
1 answer

Regex pattern for tweets

I am building a tweet classification model, and I am having trouble finding a regex pattern that fits what I am looking for. what I want the regex pattern to pick up: Any hashtags used in the tweet but without the hash mark (example - #omg to just…
0
votes
0 answers

Parsing a value from QByteArray through QRegExp

Through the execution of findscu.exe, I am receiving following output, stored in a QByteArray. I want to extract/parse from the whole output the value of DIMSE Status. I: Request Identifiers: I: I: # Dicom-Data-Set I: # Used TransferSyntax: Little…
mystic.06
  • 189
  • 8
0
votes
0 answers

HTML table parsing in C++ with QT

I would like to parse with a QRegular Expression this text. +7/+2+3+7Jack-of-all-trades, Versatile performance What I currently did is that: QString regex = "()(.*?)()|(
Hawke
  • 32
  • 5
0
votes
1 answer

how to find the second number in a string with Regex expression

I want a regular expression that finds the last match. the result that I want is "103-220898-44" The expression that I'm using is ([^\d]|^)\d{3}-\d{6}-\d{2}([^\d]|$). This doesn't work because it matches the first result "100-520006-90" and I want…
patas1818
  • 93
  • 1
  • 8
0
votes
1 answer

Golang Regular expression to separate a formula

Need to split something like 1-(a+b-b-d)*100 into 1, a+b-b-d, 100 I tried (\+|-|\*|\/) which will split the string into 1 (a b b d) 100
0
votes
1 answer

Regex extract parts of text after a string is matched

I have string field "event=[someevent1] ID=[000001] text=[Sample Text 123]" I need just the part inside text that is Sample Text 123 How to extract this using regex? I have tried (text=).\*$ but this doesn't work.
0
votes
0 answers

Regular expression for the set of all C real numbers

all the following patterns need to be accepted: 0, +0,-0, any integer, any integer preceded by + or - sign. .3, 3.14, +3.14159, -3.14159, 0.123, -0.123, .123, +.123 12e+2, 7e-4, 6.3e2, 6.3e+2, 6.3e-2, -6.3e+2 I am a little bit confused about how to…
Dhruvil
  • 1
  • 3
0
votes
1 answer

Regular Expressions in HTML

I hope you are well. So, as you can see, from "a-z" I have made a code to transcript every common letter (from "a" to "z") in some symbols. How can I do it when I want to transcript the letters "th" together in different symbol? I do not want the…
0
votes
1 answer

regex match whole word and punctuation with it using re.search()

New to regex. Aim- To match a whole word which might have either '.' or '-' with it at the end. I want to keep it for the .start() and .end() position calculation. txt = "The indian in. Spain." pattern = "in." x = re.search(r"\b" + pattern + r"\b"…
SMI
  • 71
  • 1
  • 11
0
votes
1 answer

how to match markdown block code between 3 grave accent

i know that this a common question but i searched a lot and not found what i need to i'm trying to create simple markdown plug but i can't match the block code i tried this regex /(^\`{3}[\w|\W]+\`{3})/gm but it's get me every thing between the…
JS_INF
  • 467
  • 3
  • 10
0
votes
2 answers

JMeter: Regular expression extractor gets the name of the column after JDBC request returned data

I faced some issue: I use JDBC request for selecting usernames data and reuse it in the login request The JDBC request returns correct data from the table But the issue that my login request uses the column name as data, so it tries to login with…
Andrew Chichick
  • 89
  • 1
  • 3
  • 8
0
votes
1 answer

Unix regular expression begginers question

I'm starting the study of regular expressions and I've been wondering how can I build and test the regular expression in UNIX notation for all vowel strings that contain the substring "ai" or "ui". would it simply be something like: (ai|ui) ? How…
0
votes
1 answer

Can I extract two words from a sentence using a regular expression?

I want to use a regular expression to extract two words from a sentence: Mobile and Application. It should only be extracted when there are two words. For example, abcd Mobile defe Application is also true. Mobile Application asdbfdvdsc is also…
Quack
  • 680
  • 1
  • 8
  • 22