regex

  1. H

    I Hate Regex, Part 2

    When people say they hate RegEx, they don't mean they hate RegEx itself, they usually hate the syntax and morphology of RegEx. That is why it is such a controversial topic. The functionality of RegEx is useful, although internally it is quite dirty with rules that allow some ambiguity and...
  2. Lucas Eduardo

    Android Question Regex for Australian phone number validation

    Hello, i'm trying to make a regex of australian numbers for mobile and landline with area code. It can accept just this two options. +61 0456-708-900 +61 02-1234-1234 Can someone help me with this? Thank you.
  3. LucaMs

    B4J Question Regex help (I love, hate and don't know it!)

    This line: ExtraChars = Regex.Replace ("([^a-z])", ExtraChars, "") should "remove" all lowercase letters from ExtraChars (replace with empty strings). If ExtraChars is: "5?" it removes all. --- Actually, the complete thing I would need is a regex expression to accept any letters and special...
  4. Michael2150

    Android Question Get a input hint generated for a certain regex

    Hi this isn't an important question more just out of interest, but I was wondering if there is some sort of algorithm that could generate an input hint for something like an edittext. This hint should be derived from a regex. For example the regex input being "^(?=.*[1-9].*)[0-9]{3}$" and the...
  5. Alexander Stolte

    Android Code Snippet [B4X] Check Valid E-Mail Format

    Private Sub EmailAddressCheck(email As String) As Boolean Return Regex.IsMatch("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$",email) End Sub If EmailAddressCheck("test@b4x.de") = True Then Log("E-Mail is valid") Else...
  6. Alexander Stolte

    Android Code Snippet [B4X] Count Regex Matches

    Sub CountMatches(text As String,pattern As String) As Int Dim tmp_count As Int = 0 Dim Matcher1 As Matcher Matcher1 = Regex.Matcher(pattern, text) Do While Matcher1.Find tmp_count = tmp_count +1 Loop Return tmp_count End Sub
  7. W

    Android Question Regex string contains some letter

    I need a regex expression to detect if a string contains some letters. The string can contain everything but I need to know if there are some alphabetic characters in.
  8. R

    Android Question Suggestion to add to popup help

    Wasted some time to debug an algorithm as I wasn't aware that the pipe character (|) in Regex is a special character and needs to be escaped. Took some time to pinpoint the problem and made the mistake to not search the forum and coded a split function: Sub Split(strSplitter As String...
  9. peacemaker

    Android Question Regex in B4A 9.30

    HI, All Before update to B4A 9.30 this sub worked OK: Sub IfFormattedQR (text As String) As Boolean Dim res As Boolean = Regex.IsMatch("\d{4,}", text) Return res End Sub Strings like "TEST0000", "TEST9999"... were matched OK, as on https://regex101.com After update to B4A v.9.30 ...
  10. walterf25

    Android Question Regular Expression

    Hello All, i need some help figuring out how to write a regular expression to parse a very specific group of data from a large file, I have tried several patterns that I have found online but non of them return the results I'm trying to achieve. I have tried the following: But again it doesn't...
  11. Flavio SOuza

    Android Question [Solved] How to pick up HTML content with B4A

    Hi, I'm new to B4A, I was programming in PHP about 5 years ago. I'm venturing and enjoying the B4A. My question is, I have an HTML and I need to get the contents of these HTML. Follow the HTML link and print from the part I need to capture. I thank you for your attention. URL -> html...
  12. Maodge

    Android Question [solved]regex question

    hi, i test my regex on web https://regex101.com (javascript) realize a function ,get all strings between "{" and "}" from a file. it works OK, and matched all. see attached pic but when i use it inB4A, it does not work. s1 = File.ReadString(File.DirAssets,"songgrouplist.txt")...
  13. MarkusR

    Android Question [solved] Regex i need "name1.name2" into "Name1 Name2"

    hello, is there a way to replace the first char of a word into uppercase? i have "name1.name2" i need "Name1 Name2" User = User.Replace( "."," ") User = Regex.Replace( "\b[a-z]",User, "$0") ???
  14. R

    B4J Tutorial [SQLite] Make Custom Functions and Regex

    SQLite3 has the REGEXP keyword. That means we can do SQLite queries like SELECT * FROM table1 WHERE col1 REGEXP '\d+[a-z]+\d*'; . Unfortunately, the REGEXP keyword references an SQLite user defined function that is not defined by default. That means if we want to use REGEXP in our SQLite...
Top