regex

  1. C

    B4J Question Regex for (simple) mathematical expression

    I'm trying to come up with a set of regex checks to validate a string that should be a valid mathematical expression. I'm limiting the expression to include: The 4 standard operators: +, -, *, / Curly brackets: ( and ) Integers and decimals. So I'm not allowing any functions like min, max, sin...
  2. epiCode

    Android Question Regex Replace with Unicode Support ?

    I use this pattern to detect all matching numbers irrespective of unicode script which is \p{N}. It works fine on all regex testing sites but it returns a blank string when used with regex.replace. Sub RemoveNumbersAndBrackets(inputString As String) As String Dim outputString As String...
  3. erol34

    B4J Tutorial Office Scanner tutorial

    Hi friends, I wrote a B4J program and a comprehensive tutorial in my blog page. It shows who is online in local network by names of persons. It scans 254 ip numbers in less than one minute.. You can see the complete source code and steps to follow for beginners, including installation and...
  4. S

    Android Question Get Text

    hi How can I get username and password values from the text below? Username: user4eir7yhm Password: uh6r0cdh
  5. behnam_tr

    B4J Question Help Regex in java

    hi i have this string in java i want to split and add to map then add to list My main problem is in the Regex section. Model SerialNumber Size GIGABYTE GP-GSM2NE3512GNTD 6479_A747_3050_150B. 512105932800 ST500DM002-1BD142 Z2AA2BG0...
  6. 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...
  7. 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.
  8. 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...
  9. 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...
  10. 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("[email protected]") = True Then Log("E-Mail is valid") Else...
  11. 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
  12. 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.
  13. 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...
  14. 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 ...
  15. 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...
  16. 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...
  17. 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")...
  18. 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") ???
  19. 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