List Info

Thread: Matching substrings within a Regex




Matching substrings within a Regex
user name
2006-05-16 21:55:28
the pattern 4 this would be

AccountNumber="(\d)\d*".*?StreetNumber=&qu
ot;\1\d*"

w/SingleLine Option ON

be aware that it 'll match on broken strings like : (it's
a whole
match)

AccountNumber="11324324" blablablablabla
AccountNumber="345635" blabla
StreetNumber="6789689"
StreetNumber="11322345"

i.e when by mistake one Acc#-Street# pair is nested inside
another.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Matching substrings within a Regex
user name
2006-05-16 21:58:50
if u had shown what kind of text that *blahblah* is , we
could try and
write a more robust regex 4 this.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Matching substrings within a Regex
user name
2006-05-17 13:56:22
>if u had shown what kind of text that *blahblah* is , we
could try and
>write a more robust regex 4 this.

Thanks for the response.
I am only using this expression for manually searching for
irregularities in a log file, so it doesn't have to bee too
robust;
it's a one time deal.
I didn't know about backreferences, and that was what was
holding me
back.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Matching substrings within a Regex
user name
2006-05-17 14:35:05
>if u had shown what kind of text that *blahblah* is , we
could try and
>write a more robust regex 4 this.

Sergei, perhaps you could help me with another problem I'm
having.
I'm using a tool called Windows Grep 2.3, and I can't seem
to get it to
recognize certain expressions.

Example:
I cannot get GREP to recognize the following expression:
     \d

Although it will recognize:
   [0-9][0-9][0-9][0-9]

I am having the same problem with the search utility in
Visual Studio
dot net.
Do these tools require some special syntax that I am not
aware of?

Thanks,
Jonathan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Matching substrings within a Regex
user name
2006-05-17 15:34:41
i'm 99% sure that any regex tool should recognize such a
basic pattern
as

\d

let alone VStudio where I work myself. Can u show more
details on what
u r doing?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Matching substrings within a Regex
user name
2006-05-17 15:49:00
>let alone VStudio where I work myself. Can u show more
details on what
>u r doing?

The following instructions refer to VS2003, but the VS2005
editor is
very similar:

1) Open up visual studio and create a new text file.
    A new file should be visible in the editor.

2)  Into the file, enter this string:

     sdfgsfdg1234sdfgsf

3)  In the IDE menu, select Edit --> Find and Replace
--> Find.
Check the checkbox that says "Use regular
expressions" and type in the
following search string:

     \d

The string won't be found.

The following search string works however:

     [0-9][0-9][0-9][0-9]

I don't know if this is a limitation of the tool, but
Windows GREP
behaves the same way!

Thanks,
Jonathan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Matching substrings within a Regex
user name
2006-05-17 16:09:26
u seem to be using a (very) light-weight Find/Replace applet
in
VStidio, much like MS Word Fid/Replace with some (very
little ) regex
support (MSoft even have decency not to call it regex but
rather
'wildcards' inside the app). This kind of toll will not
indeed offer u
even such basic syntax as \d or \w.

The Q now is why would u want to use this limited tool,
having all
tremendously versatile  regex power of MS VStudio within
your reach?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )