Thread: Regex examples
View Single Post
Old 04-16-2014, 11:13 PM   #333
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,167
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Alex2110 View Post
How can I create a regular expression that will find all occurrence of these three characters $#}?
I mean if the target string is: abc$456#fgh}890
the matches will be : 3 at position 4,8,12

I tried the expression [$#}] and it finds only one match (the one for the $ character).
Remember to escape
([a-z]{3})\$(\d+)\#([a-z]{3})\}(\d+)

4 captures shown
theducks is offline   Reply With Quote