If you merely wish to DISPLAY a number to a fixed decimal precision, as distinct from actually entering the number itself thus, you can select the field and set the precision in the Data Inspector (see screenshot). For example, if you entered the number 28 in a field, the setting shown would mean it would display as 28.000000.
Plus, I am wondering whether FileMaker accepts Regular Expression? If so, could you please kindly show me how?
Regular Expressions are not part of the FileMaker Pro toolset.
Its built-in pattern matching is limited to Position() and PatternCount() which will find a specific string inside another string. If your needs are very limited, it may be sufficient to use these functions in combination with other text functions, e.g. Left(), Right(), Middle(), and perhaps recursive custom functions. It won't be as good as real Regular Expression functions.
There are choices of FileMaker plug-ins for adding Regular Expression matching or similar functionality. These plug-ins usually do this by adding access to a full programming language that has Regular Expressions or similar functionality.
I can provide an example of using the pattern matching capabilities of the LuaFy FileMaker plug-in that provides the Lua scripting language. (Unlike popular stand-alone languages such as PHP or Java, Lua is a small scripting language created specifically for the purpose of being embedded in a host program.) I am the developer of the LuaFy plug-in.
Assuming that you have the LuaFy plug-in installed and gain access to the new functions provided by LuaFy, the FileMaker calculation
LuaFy_CallFunction("string.match"; "We have 42 products in stock."; "%d+ %a+")
will return the value "42 products".
The "%d+ %a+" string is written in Lua's native pattern matching language which provides most of the functionality of Regular Expressions. %d+ means find one or more digits. %a+ means find one or more letters. "%d+ %a+" thus matchines one or more digits followed by a space followed by one or more letters. LuaFy also comes with an additional library of functions (LPEG) that provide a more elaborate regular expression grammar.