|
|
Browse by Tags
All Tags » backreference
Showing page 1 of 2 (13 total posts)
-
Software Environment:Renamer4Mac, TextWrangler (both using grep with perl-compatible regex as their backend)
Given String:My File 1.txt
Regex search "Find a single digit prepended by a non-digit..."
([^\d])(\d{1})
Regex replace "...and prepend with it with a leading zero":
\10\2
Expected result:My File 01.txt
Effective ...
-
Hello,
I need help!
I got this password validation expression (?=.{6,})(?=(.*\d){1,})(?=(.*\W){1,}) and should add additional "rule".
The rules in this expression are: the pwd has to be at least 6 chars long, contain at least one digit and contain at least one special character.
The "rule" or expression I should add, should ...
-
Sorry for not mentioning the programming language. I am using PHP.
But the above examples still do not specifically match strings that have three consecutive letters, instead they just see if there are three letters in that string and then print that string if therer is a match.
Again, what would be the regex ...
-
Hello, this is my first post so bear with me. I made a quick search through the forum and found nothing, so any feedback is appreciated.
Recently I have been studying spam using regular expressions in a mail proxy called SpamPal to cleanly divide each message into folders that best describe their characteristics. I feel I grasp the basics of the ...
-
I ran into an interesting situation where back references overwrite previous changes in a regular expression.
I needed a regular expression that updated a pattern but also checked for something that comes before the pattern. It should leave everything before the pattern as it was before the updates. There can be multiple matches of ...
-
In the context of the regex dialect of XSLT 2.0, I am looking for two
"meta-regexes" that analyse other regexes. Each is discussed in a part
of its own.
(Part 1 posted as: Meta-regex for variable-length matching regexes (XSLT))
Part 2
Aim: A regex that provides for pre-calculating the length of the match
that a fixed-length matching ...
-
In the context of the regex dialect of XSLT 2.0, I am looking for two
"meta-regexes" that analyse other regexes. Each is discussed in a part
of its own.
(Part 2 posted as: Meta-regex to find fixed length of regex match (XSLT))
Part 1
Aim: A regex that would identify all those regexes that might yield
matches of varying length, as ...
-
I need a regex that matches a string containing a delimited list of digits. While this seems fairly straightforward, the following requirements must be met:
1) Any number of spaces that occur before or after a delimiter should be accepted (e.g. '3 , 9 ' is OK)
2) The string can ...
-
String: cxaaz0a9mmm
Pattern ([ab])\1 returns 1 match aa
Pattern ([ab])[\1] returns no mathches (expected: as above)
Pattern ([ab])[^\1] returns 2 matches aa and a9 (expected and wanted: 1 match a9)
Please explain why single-character backreference does not work as expected [by myself :-( ] and give me recommendation how to match ...
-
In the following string:
<div class="x" bla bla bla <div class="x" bla bla bla <div class="x" bla bla bla EXAMPLE STRING
I want to match: <div class="x" bla bla bla EXAMPLE STRING
NOT
<div class="x" bla bla bla <div class="x" bla bla bla <div ...
1
|
|
|