|
List Info
Thread: Finding Acronyms
|
|
| Finding Acronyms |

|
2006-06-30 19:41:37 |
Hi folks. I'm looking to write a regex that can match any
string of
upper case letters and numbers such as JPG2000, or JPG but
not just
numbers like 2000. I understand enough of regex to know that
<[A-Z0-9] > will match JPG2000, JPG, and 2000, but how do I
exclude
matches like 2000?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|
|
| Finding Acronyms |

|
2006-06-30 20:00:18 |
Talikan wrote:
> Hi folks. I'm looking to write a regex that can match
any string of
> upper case letters and numbers such as JPG2000, or JPG
but not just
> numbers like 2000. I understand enough of regex to know
that
> <[A-Z0-9] > will match JPG2000, JPG, and 2000,
but how do I exclude
> matches like 2000?
you want to make sure that there are at least one capital
letters in
your strings, right? if so, you can just prepend one more
look ahead
construct into your previous pattern, like:
^(?=.*?[A-Z])[A-Z0-9]+$
I dont know what are ' ', '<' and '>' in your pattern
'<[A-Z0-9] >'
though..
Xicheng
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|
|
| Finding Acronyms |

|
2006-07-05 20:31:27 |
Thanks Xicheng! That works great with regex engines that
work properly.
Unfortunately I'm using Microsoft Visual Basic. It has odd
rules and
that doesn't work for it. That was what the ' ',
'<' and '>' were for.
' '
is MS's version of '+', and '<' and '>' are in
place of '^' and
'$'. Even when I converted those symbols it still doesn't
work, it
returns a null selection. Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|
|
| Finding Acronyms |

|
2006-07-06 00:51:07 |
Talikan wrote:
> Thanks Xicheng! That works great with regex engines
that work properly.
> Unfortunately I'm using Microsoft Visual Basic. It has
odd rules and
> that doesn't work for it. That was what the ' ',
'<' and '>' were for.
> ' ' is MS's version of '+', and '<' and
'>' are in place of '^' and
> '$'. Even when I converted those symbols it still
doesn't work, it
> returns a null selection. Any ideas?
you are welcome.
I guess it doesnot support look adhead. so probably you can
just try:
<[0-9A_Z]*[A-Z][0-9A-Z]*>
where you may need to change * to MS-VB's zero or more of
the preceding
character, as that of all Perl-compatible regexes in Perl,
C#, Java,
PHP....
Good luck,
Xicheng
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|
|
[1-4]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|